diff options
author | Elijah Newren <newren@gmail.com> | 2022-08-19 04:28:10 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-19 17:45:08 (GMT) |
commit | 257418c59040c13bfa839e01922e21833cda6a52 (patch) | |
tree | 5f511f47be827d91b3a11bfcf973dfe951c3b424 /revision.h | |
parent | 1838e21cff17f97900a4987b35ba70ca48bce4b7 (diff) | |
download | git-257418c59040c13bfa839e01922e21833cda6a52.zip git-257418c59040c13bfa839e01922e21833cda6a52.tar.gz git-257418c59040c13bfa839e01922e21833cda6a52.tar.bz2 |
revision: allow --ancestry-path to take an argument
We have long allowed users to run e.g.
git log --ancestry-path master..seen
which shows all commits which satisfy all three of these criteria:
* are an ancestor of seen
* are not an ancestor of master
* have master as an ancestor
This commit allows another variant:
git log --ancestry-path=$TOPIC master..seen
which shows all commits which satisfy all of these criteria:
* are an ancestor of seen
* are not an ancestor of master
* have $TOPIC in their ancestry-path
that last bullet can be defined as commits meeting any of these
criteria:
* are an ancestor of $TOPIC
* have $TOPIC as an ancestor
* are $TOPIC
This also allows multiple --ancestry-path arguments, which can be
used to find commits with any of the given topics in their ancestry
path.
Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
-rw-r--r-- | revision.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -48,6 +48,7 @@ */ #define NOT_USER_GIVEN (1u<<25) #define TRACK_LINEAR (1u<<26) +#define ANCESTRY_PATH (1u<<27) #define ALL_REV_FLAGS (((1u<<11)-1) | NOT_USER_GIVEN | TRACK_LINEAR | PULL_MERGE) #define DECORATE_SHORT_REFS 1 @@ -164,6 +165,13 @@ struct rev_info { cherry_mark:1, bisect:1, ancestry_path:1, + + /* True if --ancestry-path was specified without an + * argument. The bottom revisions are implicitly + * the arguments in this case. + */ + ancestry_path_implicit_bottoms:1, + first_parent_only:1, exclude_first_parent_only:1, line_level_traverse:1, @@ -306,6 +314,7 @@ struct rev_info { struct saved_parents *saved_parents_slab; struct commit_list *previous_parents; + struct commit_list *ancestry_path_bottoms; const char *break_bar; struct revision_sources *sources; |