diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-03 23:44:48 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-03 14:55:21 -0700 |
commit | 86829f3f3ea62853a4a632637ade6de94a1f4c7c (patch) | |
tree | 9b50facfa74dd050a84ef13207d4e4f0b69c5d18 /revision.h | |
parent | d6fd04375f9196f8b203d442f235bd96a1a068cc (diff) | |
download | git-86829f3f3ea62853a4a632637ade6de94a1f4c7c.tar.gz |
revision: optionally record matches with pathspec elements
Unlike "git add" and other end-user facing commands, where it is
diagnosed as an error to give a pathspec with an element that does
not match any path, the diff machinery does not care if some
elements of the pathspec do not match. Given that the diff
machinery is heavily used in pathspec-limited "git log" machinery,
and it is common for a path to come and go while traversing the
project history, this is usually a good thing.
However, in some cases we would want to know if all the pathspec
elements matched. For example, "git add -u <pathspec>" internally
uses the machinery used by "git diff-files" to decide contents from
what paths to add to the index, and as an end-user facing command,
"git add -u" would want to report an unmatched pathspec element.
Add a new .ps_matched member next to the .prune_data member in
"struct rev_info" so that we can optionally keep track of the use of
.prune_data pathspec elements that can be inspected by the caller.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
-rw-r--r-- | revision.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/revision.h b/revision.h index 94c43138bc..0e470d1df1 100644 --- a/revision.h +++ b/revision.h @@ -142,6 +142,7 @@ struct rev_info { /* Basic information */ const char *prefix; const char *def; + char *ps_matched; /* optionally record matches of prune_data */ struct pathspec prune_data; /* |