]> git.ipfire.org Git - thirdparty/git.git/commit - t/t6120-describe.sh
describe: teach describe negative pattern matches
authorJacob Keller <jacob.keller@gmail.com>
Wed, 18 Jan 2017 23:06:08 +0000 (15:06 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Jan 2017 02:33:17 +0000 (18:33 -0800)
commit77d21f29eaddb1fbe82e013ea42d4e0180bbdda2
tree589f2e6d1fc2efdddc2c00c7d6f21babb9eba369
parent43f8080eaff82e7aedaec5aa3abfd115cf1af695
describe: teach describe negative pattern matches

Teach git-describe the `--exclude` option which will allow specifying
a glob pattern of tags to ignore. This can be combined with the
`--match` patterns to enable more flexibility in determining which tags
to consider.

For example, suppose you wish to find the first official release tag
that contains a certain commit. If we assume that official release tags
are of the form "v*" and pre-release candidates include "*rc*" in their
name, we can now find the first release tag that introduces the commit
abcdef:

  git describe --contains --match="v*" --exclude="*rc*" abcdef

Add documentation, tests, and completion for this change.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-describe.txt
builtin/describe.c
contrib/completion/git-completion.bash
t/t6120-describe.sh