Skip to content

Commit d8c6dc2

Browse files
committed
Merge branch 'ah/doc-describe'
Doc update. * ah/doc-describe: describe-doc: clarify default length of abbreviation
2 parents f44416c + bfe35a6 commit d8c6dc2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Documentation/git-describe.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ OPTIONS
6363
Automatically implies --tags.
6464

6565
--abbrev=<n>::
66-
Instead of using the default 7 hexadecimal digits as the
67-
abbreviated object name, use <n> digits, or as many digits
68-
as needed to form a unique object name. An <n> of 0
66+
Instead of using the default number of hexadecimal digits (which
67+
will vary according to the number of objects in the repository with
68+
a default of 7) of the abbreviated object name, use <n> digits, or
69+
as many digits as needed to form a unique object name. An <n> of 0
6970
will suppress long format, only showing the closest tag.
7071

7172
--candidates=<n>::
@@ -139,8 +140,11 @@ at the end.
139140

140141
The number of additional commits is the number
141142
of commits which would be displayed by "git log v1.0.4..parent".
142-
The hash suffix is "-g" + unambiguous abbreviation for the tip commit
143-
of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`).
143+
The hash suffix is "-g" + an unambigous abbreviation for the tip commit
144+
of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
145+
length of the abbreviation scales as the repository grows, using the
146+
approximate number of objects in the repository and a bit of math
147+
around the birthday paradox, and defaults to a minimum of 7.
144148
The "g" prefix stands for "git" and is used to allow describing the version of
145149
a software depending on the SCM the software is managed with. This is useful
146150
in an environment where people may use different SCMs.

0 commit comments

Comments
 (0)