summaryrefslogtreecommitdiff
path: root/ref-filter.h
diff options
context:
space:
mode:
authorAaron Lipman <alipman88@gmail.com>2020-09-16 02:08:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-16 19:38:10 (GMT)
commit21bf933928c02372633b88aa6c4d9d71271d42b3 (patch)
treee2ad37586b8eef4cb8bee34ff495ed4d7aed0c46 /ref-filter.h
parent415af72b174802a45300039ef2bc1127d48dc0c0 (diff)
downloadgit-21bf933928c02372633b88aa6c4d9d71271d42b3.zip
git-21bf933928c02372633b88aa6c4d9d71271d42b3.tar.gz
git-21bf933928c02372633b88aa6c4d9d71271d42b3.tar.bz2
ref-filter: allow merged and no-merged filters
Enable ref-filter to process multiple merged and no-merged filters, and extend functionality to git branch, git tag and git for-each-ref. This provides an easy way to check for branches that are "graduation candidates:" $ git branch --no-merged master --merged next If passed more than one merged (or more than one no-merged) filter, refs must be reachable from any one of the merged commits, and reachable from none of the no-merged commits. Signed-off-by: Aaron Lipman <alipman88@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.h')
-rw-r--r--ref-filter.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/ref-filter.h b/ref-filter.h
index 8ecc33c..2d13928 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -23,6 +23,9 @@
#define FILTER_REFS_DETACHED_HEAD 0x0020
#define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)
+#define DO_MERGE_FILTER_UNREACHABLE 0
+#define DO_MERGE_FILTER_REACHABLE 1
+
struct atom_value;
struct ref_sorting {
@@ -54,13 +57,8 @@ struct ref_filter {
struct oid_array points_at;
struct commit_list *with_commit;
struct commit_list *no_commit;
-
- enum {
- REF_FILTER_MERGED_NONE = 0,
- REF_FILTER_MERGED_INCLUDE,
- REF_FILTER_MERGED_OMIT
- } merge;
- struct commit *merge_commit;
+ struct commit_list *reachable_from;
+ struct commit_list *unreachable_from;
unsigned int with_commit_tag_algo : 1,
match_as_path : 1,