diff options
| author | Jacob Keller <jacob.keller@gmail.com> | 2026-06-01 16:36:08 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-06-02 09:31:12 +0900 |
| commit | 1891707d1b8bb0ac3c47343e881fcf28ec69457a (patch) | |
| tree | 74aad3bc5b6d829ac92c11da8858f5b200494e6d /t/t4013/diff.diff_initial..side | |
| parent | a89346e34a937f001e5d397ee62224e3e9852040 (diff) | |
describe: fix --exclude, --match with --contains and --all
git describe --contains acts as a wrapper around git name-rev. When
operating with --contains and --all, the --match and --exclude patterns
are not properly forwarded to name-rev as --exclude and --refs options.
This results in the command silently discarding match and exclude
requests from the user when operating in --all mode.
We could check and die() if the user provides --contains, --all, and
--match/--exclude. However, its also straight forward to just pass the
filters down to git name-rev.
Notice that the documentation for --match and --exclude mention the
--all mode. It explains that they operate on refs with the prefix
refs/tags, and additionally refs/heads and refs/remotes when using
--all.
Fix the describe logic to pass the patterns down with the appropriate
prefixes when --all is provided. This fixes the support to match the
documented behavior.
Add tests to check that this works as expected.
Reported-by: Tuomas Ahola <taahol@utu.fi>
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
