Skip to contentSkip to conversation

git-describe hash length

PATCH In review Martin Pirker 4 participants 4 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

Hi!

john@doe:/workspace$ git version
git version 1.6.1
john@doe:/workspace$ git describe
fatal: cannot describe '7aee61cc635a923e70b74091486742481ee0928b'
john@doe:/workspace$ git describe --always
7aee61c
john@doe:/workspace$ git describe --always --abbrev=8
7aee61cc

man git-describe:

--abbrev=<n>
Instead of using the default 8 hexadecimal digits as the abbreviated object name, use <n> digits.

There is one character missing from default or what am I missing?

Thanks,
Martin

#1 lore raw
Quoted 15 lines · Martin Pirker

Hi!

john@doe:/workspace$ git version
git version 1.6.1
john@doe:/workspace$ git describe
fatal: cannot describe '7aee61cc635a923e70b74091486742481ee0928b'
john@doe:/workspace$ git describe --always
7aee61c
john@doe:/workspace$ git describe --always --abbrev=8
7aee61cc

man git-describe:

Quoted 7 lines

--abbrev=<n>
Instead of using the default 8 hexadecimal digits as the abbreviated object name, use<n> digits.

There is one character missing from default or what am I missing?

The man page is wrong:

cache.h:#define DEFAULT_ABBREV 7 builtin-describe.c:static int abbrev = DEFAULT_ABBREV;

tom

#2 lore raw

PATCH 1/1 Fix Documentation for git-describe

The documentation for git-describe says the default abbreviation is 8 hexadecimal digits while cache.c clearly shows DEFAULT_ABBREV set to 7. This patch corrects the documentation.

---

Quoted 15 lines · On Thursday 2009 January 22 06:34:06 Tomas Carnecky wrote:
Quoted 14 lines · Martin Pirker
john@doe:/workspace$ git version
git version 1.6.1
john@doe:/workspace$ git describe
fatal: cannot describe '7aee61cc635a923e70b74091486742481ee0928b'
john@doe:/workspace$ git describe --always
7aee61c
john@doe:/workspace$ git describe --always --abbrev=8
7aee61cc

man git-describe:
--abbrev=<n>
Instead of using the default 8 hexadecimal digits as the abbreviated object name, use<n> digits.

Quoted 6 lines
Quoted 1 line

There is one character missing from default or what am I missing?

The man page is wrong:

cache.h:#define DEFAULT_ABBREV 7 builtin-describe.c:static int abbrev = DEFAULT_ABBREV;

Let's fix it then! This is a patch against maint.

Is there any way to include values from the source as text in the ascidoc other than copy-and-paste? It would be nice if we don't have to do this fix again in the future.

I did a quick scan of 'git grep 8 -- Documentation' and didn't see anywhere else this needed fixing.

 Documentation/git-describe.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/git-describe.txt +1 -1
index 3d79f05..a30c5ac 100644
@@ -43,7 +43,7 @@ OPTIONS
 	Automatically implies --tags.
 
 --abbrev=<n>::
-	Instead of using the default 8 hexadecimal digits as the
+	Instead of using the default 7 hexadecimal digits as the
 	abbreviated object name, use <n> digits.
 
 --candidates=<n>::
Signature · 6 lines
1.6.0.2
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
[email protected]                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/