vendor/libgit2/include/git2/revwalk.h in rugged-0.19.0 vs vendor/libgit2/include/git2/revwalk.h in rugged-0.21.0
- old
+ new
@@ -85,11 +85,11 @@
GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker);
/**
* Mark a commit to start traversal from.
*
- * The given OID must belong to a commit on the walked
+ * The given OID must belong to a committish on the walked
* repository.
*
* The given commit will be used as one of the roots
* when starting the revision walk. At least one commit
* must be pushed onto the walker before a walk can
@@ -106,12 +106,15 @@
*
* The OIDs pointed to by the references that match the given glob
* pattern will be pushed to the revision walker.
*
* A leading 'refs/' is implied if not present as well as a trailing
- * '/ *' if the glob lacks '?', '*' or '['.
+ * '/\*' if the glob lacks '?', '\*' or '['.
*
+ * Any references matching this glob which do not point to a
+ * committish will be ignored.
+ *
* @param walk the walker being used for the traversal
* @param glob the glob pattern references should match
* @return 0 or an error code
*/
GIT_EXTERN(int) git_revwalk_push_glob(git_revwalk *walk, const char *glob);
@@ -125,11 +128,11 @@
GIT_EXTERN(int) git_revwalk_push_head(git_revwalk *walk);
/**
* Mark a commit (and its ancestors) uninteresting for the output.
*
- * The given OID must belong to a commit on the walked
+ * The given OID must belong to a committish on the walked
* repository.
*
* The resolved commit and all its parents will be hidden from the
* output on the revision walk.
*
@@ -145,12 +148,15 @@
* The OIDs pointed to by the references that match the given glob
* pattern and their ancestors will be hidden from the output on the
* revision walk.
*
* A leading 'refs/' is implied if not present as well as a trailing
- * '/ *' if the glob lacks '?', '*' or '['.
+ * '/\*' if the glob lacks '?', '\*' or '['.
*
+ * Any references matching this glob which do not point to a
+ * committish will be ignored.
+ *
* @param walk the walker being used for the traversal
* @param glob the glob pattern references should match
* @return 0 or an error code
*/
GIT_EXTERN(int) git_revwalk_hide_glob(git_revwalk *walk, const char *glob);
@@ -164,22 +170,22 @@
GIT_EXTERN(int) git_revwalk_hide_head(git_revwalk *walk);
/**
* Push the OID pointed to by a reference
*
- * The reference must point to a commit.
+ * The reference must point to a committish.
*
* @param walk the walker being used for the traversal
* @param refname the reference to push
* @return 0 or an error code
*/
GIT_EXTERN(int) git_revwalk_push_ref(git_revwalk *walk, const char *refname);
/**
* Hide the OID pointed to by a reference
*
- * The reference must point to a commit.
+ * The reference must point to a committish.
*
* @param walk the walker being used for the traversal
* @param refname the reference to hide
* @return 0 or an error code
*/
@@ -230,10 +236,18 @@
*
*/
GIT_EXTERN(int) git_revwalk_push_range(git_revwalk *walk, const char *range);
/**
+ * Simplify the history by first-parent
+ *
+ * No parents other than the first for each commit will be enqueued.
+ */
+GIT_EXTERN(void) git_revwalk_simplify_first_parent(git_revwalk *walk);
+
+
+/**
* Free a revision walker previously allocated.
*
* @param walk traversal handle to close. If NULL nothing occurs.
*/
GIT_EXTERN(void) git_revwalk_free(git_revwalk *walk);
@@ -244,9 +258,33 @@
*
* @param walk the revision walker
* @return the repository being walked
*/
GIT_EXTERN(git_repository *) git_revwalk_repository(git_revwalk *walk);
+
+/**
+ * This is a callback function that user can provide to hide a
+ * commit and its parents. If the callback function returns non-zero value,
+ * then this commit and its parents will be hidden.
+ *
+ * @param commit_id oid of Commit
+ * @param payload User-specified pointer to data to be passed as data payload
+ */
+typedef int(*git_revwalk_hide_cb)(
+ const git_oid *commit_id,
+ void *payload);
+
+/**
+ * Adds a callback function to hide a commit and its parents
+ *
+ * @param walk the revision walker
+ * @param hide_cb callback function to hide a commit and its parents
+ * @param payload data payload to be passed to callback function
+ */
+GIT_EXTERN(int) git_revwalk_add_hide_cb(
+ git_revwalk *walk,
+ git_revwalk_hide_cb hide_cb,
+ void *payload);
/** @} */
GIT_END_DECL
#endif