Skip to content

Commit fb87327

Browse files
asheidukgitster
authored andcommitted
doc: rewrite description for rev-parse --short
`git rev-parse --short` is not a generic modifier but just a variant of `--verify` and considers the given length only as a suggestion to ensure uniqueness. Signed-off-by: Andreas Heiduk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b06d364 commit fb87327

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Documentation/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ core.abbrev::
862862
computed based on the approximate number of packed objects
863863
in your repository, which hopefully is enough for
864864
abbreviated object names to stay unique for some time.
865+
The minimum length is 4.
865866

866867
add.ignoreErrors::
867868
add.ignore-errors (deprecated)::

Documentation/git-rev-parse.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ can be used.
126126
'git diff-{asterisk}'). In contrast to the `--sq-quote` option,
127127
the command input is still interpreted as usual.
128128

129+
--short[=length]::
130+
Same as `--verify` but shortens the object name to a unique
131+
prefix with at least `length` characters. The minimum length
132+
is 4, the default is the effective value of the `core.abbrev`
133+
configuration variable (see linkgit:git-config[1]).
134+
129135
--not::
130136
When showing object names, prefix them with '{caret}' and
131137
strip '{caret}' prefix from the object names that already have
@@ -136,12 +142,6 @@ can be used.
136142
The option core.warnAmbiguousRefs is used to select the strict
137143
abbreviation mode.
138144

139-
--short::
140-
--short=number::
141-
Instead of outputting the full SHA-1 values of object names try to
142-
abbreviate them to a shorter unique name. When no length is specified
143-
7 is used. The minimum length is 4.
144-
145145
--symbolic::
146146
Usually the object names are output in SHA-1 form (with
147147
possible '{caret}' prefix); this option makes them output in a

0 commit comments

Comments
 (0)