diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-08-26 11:32:24 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-26 11:32:24 -0700 |
| commit | 3222718ad7d9dfc50e31037bf2f3977d2071fb75 (patch) | |
| tree | fb2bd5fb5cd5d53c84daa07b3a0d6356b3a59583 /ref-filter.h | |
| parent | Merge branch 'jk/send-email-translate-aliases' (diff) | |
| parent | p1500: add is-base performance tests (diff) | |
| download | git-3222718ad7d9dfc50e31037bf2f3977d2071fb75.tar.gz git-3222718ad7d9dfc50e31037bf2f3977d2071fb75.zip | |
Merge branch 'ds/for-each-ref-is-base'
'git for-each-ref' learned a new "--format" atom to find the branch
that the history leading to a given commit "%(is-base:<commit>)" is
likely based on.
* ds/for-each-ref-is-base:
p1500: add is-base performance tests
for-each-ref: add 'is-base' token
commit: add gentle reference lookup method
commit-reach: add get_branch_base_for_tip
Diffstat (limited to 'ref-filter.h')
| -rw-r--r-- | ref-filter.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ref-filter.h b/ref-filter.h index 27ae1aa0d1..e794b8a676 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -48,6 +48,7 @@ struct ref_array_item { struct commit *commit; struct atom_value *value; struct ahead_behind_count **counts; + char **is_base; char refname[FLEX_ARRAY]; }; @@ -101,6 +102,9 @@ struct ref_format { /* List of bases for ahead-behind counts. */ struct string_list bases; + /* List of bases for is-base indicators. */ + struct string_list is_base_tips; + struct { int max_count; int omit_empty; @@ -114,6 +118,7 @@ struct ref_format { #define REF_FORMAT_INIT { \ .use_color = -1, \ .bases = STRING_LIST_INIT_DUP, \ + .is_base_tips = STRING_LIST_INIT_DUP, \ } /* Macros for checking --merged and --no-merged options */ @@ -203,6 +208,16 @@ void filter_ahead_behind(struct repository *r, struct ref_format *format, struct ref_array *array); +/* + * If the provided format includes is-base atoms, then compute the base checks + * for those tips against all refs. + * + * If this is not called, then any is-base atoms will be blank. + */ +void filter_is_base(struct repository *r, + struct ref_format *format, + struct ref_array *array); + void ref_filter_init(struct ref_filter *filter); void ref_filter_clear(struct ref_filter *filter); |
