summaryrefslogtreecommitdiff
path: root/Documentation/git-describe.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/git-describe.txt')
-rw-r--r--Documentation/git-describe.txt32
1 files changed, 20 insertions, 12 deletions
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index 039cce2..d20ca40 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -9,7 +9,7 @@ git-describe - Show the most recent tag that is reachable from a commit
SYNOPSIS
--------
[verse]
-'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] <committish>...
+'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] <commit-ish>...
'git describe' [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]
DESCRIPTION
@@ -26,8 +26,8 @@ see the -a and -s options to linkgit:git-tag[1].
OPTIONS
-------
-<committish>...::
- Committish object names to describe.
+<commit-ish>...::
+ Commit-ish object names to describe.
--dirty[=<mark>]::
Describe the working tree.
@@ -36,12 +36,12 @@ OPTIONS
--all::
Instead of using only the annotated tags, use any ref
- found in `.git/refs/`. This option enables matching
+ found in `refs/` namespace. This option enables matching
any known branch, remote-tracking branch, or lightweight tag.
--tags::
Instead of using only the annotated tags, use any tag
- found in `.git/refs/tags`. This option enables matching
+ found in `refs/tags` namespace. This option enables matching
a lightweight (non-annotated) tag.
--contains::
@@ -57,7 +57,7 @@ OPTIONS
--candidates=<n>::
Instead of considering only the 10 most recent tags as
- candidates to describe the input committish consider
+ candidates to describe the input commit-ish consider
up to <n> candidates. Increasing <n> above 10 will take
slightly longer but may produce a more accurate result.
An <n> of 0 will cause only exact matches to be output.
@@ -81,12 +81,18 @@ OPTIONS
that points at object deadbee....).
--match <pattern>::
- Only consider tags matching the given pattern (can be used to avoid
- leaking private tags made from the repository).
+ Only consider tags matching the given `glob(7)` pattern,
+ excluding the "refs/tags/" prefix. This can be used to avoid
+ leaking private tags from the repository.
--always::
Show uniquely abbreviated commit object as fallback.
+--first-parent::
+ Follow only the first parent commit upon seeing a merge commit.
+ This is useful when you wish to not match tags on branches merged
+ in the history of the target commit.
+
EXAMPLES
--------
@@ -131,7 +137,7 @@ closest tagname without any suffix:
Note that the suffix you get if you type these commands today may be
longer than what Linus saw above when he ran these commands, as your
-git repository may have new commits whose object names begin with
+Git repository may have new commits whose object names begin with
975b that did not exist back then, and "-g975b" suffix alone may not
be sufficient to disambiguate these commits.
@@ -139,7 +145,7 @@ be sufficient to disambiguate these commits.
SEARCH STRATEGY
---------------
-For each committish supplied, 'git describe' will first look for
+For each commit-ish supplied, 'git describe' will first look for
a tag which tags exactly that commit. Annotated tags will always
be preferred over lightweight tags, and tags with newer dates will
always be preferred over tags with older dates. If an exact match
@@ -148,10 +154,12 @@ is found, its name will be output and searching will stop.
If an exact match was not found, 'git describe' will walk back
through the commit history to locate an ancestor commit which
has been tagged. The ancestor's tag will be output along with an
-abbreviation of the input committish's SHA1.
+abbreviation of the input commit-ish's SHA-1. If '--first-parent' was
+specified then the walk will only consider the first parent of each
+commit.
If multiple tags were found during the walk then the tag which
-has the fewest commits different from the input committish will be
+has the fewest commits different from the input commit-ish will be
selected and output. Here fewest commits different is defined as
the number of commits which would be shown by `git log tag..input`
will be the smallest number of commits possible.