summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-07 07:22:38 +0200
committerVicent Marti <tanoku@gmail.com>2013-04-07 07:22:38 +0200
commitd9ecaf8c6f2d2d538319174e42e5c98585c902e5 (patch)
treeae3d0bee5061af1bf35fbda34f2afc2757365ee2 /include
parent2274483727b62ae155d7206668713d5346756de6 (diff)
parent2e2332857d26c7dbed3e4b940bb571da348bb5c7 (diff)
downloadlibgit2-d9ecaf8c6f2d2d538319174e42e5c98585c902e5.tar.gz
Merge remote-tracking branch 'gnprice/revwalk' into development
Diffstat (limited to 'include')
-rw-r--r--include/git2/revparse.h13
-rw-r--r--include/git2/revwalk.h17
2 files changed, 29 insertions, 1 deletions
diff --git a/include/git2/revparse.h b/include/git2/revparse.h
index 6edb7767c..edd8b3cce 100644
--- a/include/git2/revparse.h
+++ b/include/git2/revparse.h
@@ -32,6 +32,19 @@ GIT_BEGIN_DECL
*/
GIT_EXTERN(int) git_revparse_single(git_object **out, git_repository *repo, const char *spec);
+/**
+ * Parse a string with the form of a revision range, as accepted by
+ * `git rev-list`, `git diff`, and others.
+ *
+ * @param left (output) the left-hand commit
+ * @param right (output) the right-hand commit
+ * @param threedots (output) 0 if the endpoints are separated by two dots, 1 if by three
+ * @param repo the repository to find the commits in
+ * @param rangelike the rangelike string to be parsed
+ * @return 0 on success, or any error `git_revparse_single` can return
+ */
+GIT_EXTERN(int) git_revparse_rangelike(git_object **left, git_object **right, int *threedots, git_repository *repo, const char *rangelike);
+
/** @} */
GIT_END_DECL
#endif
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h
index ad57b622e..8bfe0b502 100644
--- a/include/git2/revwalk.h
+++ b/include/git2/revwalk.h
@@ -92,7 +92,7 @@ GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker);
*
* The given commit will be used as one of the roots
* when starting the revision walk. At least one commit
- * must be pushed the repository before a walk can
+ * must be pushed onto the walker before a walk can
* be started.
*
* @param walk the walker being used for the traversal.
@@ -217,6 +217,21 @@ GIT_EXTERN(int) git_revwalk_next(git_oid *out, git_revwalk *walk);
GIT_EXTERN(void) git_revwalk_sorting(git_revwalk *walk, unsigned int sort_mode);
/**
+ * Push and hide the respective endpoints of the given range.
+ *
+ * The range should be of the form
+ * <commit>..<commit>
+ * where each <commit> is in the form accepted by 'git_revparse_single'.
+ * The left-hand commit will be hidden and the right-hand commit pushed.
+ *
+ * @param walk the walker being used for the traversal
+ * @param range the range
+ * @return 0 or an error code
+ *
+ */
+GIT_EXTERN(int) git_revwalk_push_range(git_revwalk *walk, const char *range);
+
+/**
* Free a revision walker previously allocated.
*
* @param walk traversal handle to close. If NULL nothing occurs.