revision: add --except option
PATCH v3 1/1 revision: add --except option
So that it's possible to remove certain refs from the list without removing the objects that are referenced by other refs.
For example this repository:
C (crap)
B (test)
A (HEAD, master)
When using '--branches --except crap':
B (test)
A (HEAD, master)
But when using '--branches --not crap' nothing will come out.
Signed-off-by Felipe Contreras <[email protected]>
--- Documentation/git-rev-parse.txt | 6 +++ contrib/completion/git-completion.bash | 2 +- revision.c | 54 +++++++++++++++++++++++- revision.h | 3 +- t/t6112-rev-list-except.sh | 77 ++++++++++++++++++++++++++++++++++ 5 files changed, 139 insertions(+), 3 deletions(-) create mode 100755 t/t6112-rev-list-except.sh
Documentation/git-rev-parse.txt +6 -0
@@ -110,6 +110,12 @@ can be used. strip '{caret}' prefix from the object names that already have one. +--except:: + Skip the following object names. For example: + '--branches --except master' will show all the branches, except master. + This differs from --not in that --except will still show the object, if + they are referenced by another object name. + --symbolic:: Usually the object names are output in SHA-1 form (with possible '{caret}' prefix); this option makes them output in a
contrib/completion/git-completion.bash +1 -1
@@ -1386,7 +1386,7 @@ _git_ls_tree () # Options that go well for log, shortlog and gitk __git_log_common_options=" - --not --all + --not --except --all --branches --tags --remotes --first-parent --merges --no-merges --max-count=
revision.c +53 -1
83 lines not on this page · raw message
revision.h +2 -1
@@ -17,7 +17,8 @@#define SYMMETRIC_LEFT (1u<<8)#define PATCHSAME (1u<<9)#define BOTTOM (1u<<10) -#define ALL_REV_FLAGS ((1u<<11)-1) +#define SKIP (1u<<11) +#define ALL_REV_FLAGS ((1u<<12)-1)#define DECORATE_SHORT_REFS 1#define DECORATE_FULL_REFS 2
t/t6112-rev-list-except.sh new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
1.8.4-fc