diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-27 21:17:13 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-27 22:00:27 +0100 |
| commit | 155aca2da79c8cae650c4e4f387a40d8f0a66527 (patch) | |
| tree | 9b45897eec7444a158cc2363eacad44af4a72512 /include/git2/revwalk.h | |
| parent | 8f7be6ca8a79f04620ca6cf280a3a04d1d96f2c3 (diff) | |
| download | libgit2-155aca2da79c8cae650c4e4f387a40d8f0a66527.tar.gz | |
revwalk: introduce pushing and hiding by glob
git_revwalk_{push,hide}_glob() lets you push the OIDs of references
that match the specified glob. This is the basics for what git.git
does with the rev-list options --branches, --tags, --remotes and
--glob.
Diffstat (limited to 'include/git2/revwalk.h')
| -rw-r--r-- | include/git2/revwalk.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index 1af0e4291..020c898ca 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -101,6 +101,20 @@ GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker); */ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); +/** + * Push matching references + * + * The OIDs pinted to by the references that match the given glob + * pattern will be pushed to the revision walker. + * + * A leading 'refs/' is implied it not present as well as a trailing + * '/ *' if the glob lacks '?', '*' or '['. + * + * @param walk the walker being used for the traversal + * @param glob the glob pattern references should match + * @return GIT_SUCCESS or an error code + */ +GIT_EXTERN(int) git_revwalk_push_glob(git_revwalk *walk, const char *glob); /** * Mark a commit (and its ancestors) uninteresting for the output. @@ -118,6 +132,22 @@ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, const git_oid *oid); /** + * Hide matching references. + * + * The OIDs pinted 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 it not present as well as a trailing + * '/ *' if the glob lacks '?', '*' or '['. + * + * @param walk the walker being used for the traversal + * @param glob the glob pattern references should match + * @return GIT_SUCCESS or an error code + */ +GIT_EXTERN(int) git_revwalk_hide_glob(git_revwalk *walk, const char *glob); + +/** * Get the next commit from the revision walk. * * The initial call to this method is *not* blocking when |
