aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/pretty-formats.txt
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-02-14 11:10:57 +0100
committerJunio C Hamano <gitster@pobox.com>2021-02-17 09:54:33 -0800
commitb081547ec1de57162f2c1c7748aa09c861413d34 (patch)
treed6fe0220ce4c6b34e6550650891c9b412890fdce /Documentation/pretty-formats.txt
parent15ae82d5d6ccdcad00aeb456ff512d3031f03039 (diff)
downloadgit-b081547ec1de57162f2c1c7748aa09c861413d34.tar.gz
pretty: add merge and exclude options to %(describe)
Allow restricting the tags used by the placeholder %(describe) with the options match and exclude. E.g. the following command describes the current commit using official version tags, without those for release candidates: $ git log -1 --format='%(describe:match=v[0-9]*,exclude=*rc*)' Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/pretty-formats.txt')
-rw-r--r--Documentation/pretty-formats.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index bb8c05bc21..231010e6ef 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -208,8 +208,17 @@ The placeholders are:
'%cs':: committer date, short format (`YYYY-MM-DD`)
'%d':: ref names, like the --decorate option of linkgit:git-log[1]
'%D':: ref names without the " (", ")" wrapping.
-'%(describe)':: human-readable name, like linkgit:git-describe[1];
- empty string for undescribable commits
+'%(describe[:options])':: human-readable name, like
+ linkgit:git-describe[1]; empty string for
+ undescribable commits. The `describe` string
+ may be followed by a colon and zero or more
+ comma-separated options.
++
+** 'match=<pattern>': Only consider tags matching the given
+ `glob(7)` pattern, excluding the "refs/tags/" prefix.
+** 'exclude=<pattern>': Do not consider tags matching the given
+ `glob(7)` pattern, excluding the "refs/tags/" prefix.
+
'%S':: ref name given on the command line by which the commit was reached
(like `git log --source`), only works with `git log`
'%e':: encoding