git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Mosegaard Amdisen <martinmosegaard@gmail.com>
To: git@vger.kernel.org
Subject: Bug: git-describe abbrev documentation mentions wrong default
Date: Fri, 3 Aug 2018 13:16:26 +0200	[thread overview]
Message-ID: <CAAVPhBmg1=dhGPougT2fXPdA+ogenrS8T3YhbpwzTfurxcn+HA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]

The documentation for the "git describe --abbrev" flag says that the
default value is 7 hexadecimal digits:
https://github.com/git/git/blob/master/Documentation/git-describe.txt#L63
and
https://git-scm.com/docs/git-describe

I have experienced that sometimes I see 7 digits, but other times more.
The behavior seems to have changed in git 2.11.0 ("default abbreviation
length"):
https://github.com/git/git/blob/aeddbfdfa48443c034a9b28b10dfddf2f71b907f/Documentation/RelNotes/2.11.0.txt

I was able to trigger different behavior using a bash script like the one
below:

```sh
#!/bin/bash

DIR=test-git-describe
rm -rf ${DIR}
mkdir ${DIR}
cd ${DIR}
git init

# One-time test results I have seen:
# 10 tags, 10 * 10 commits: 7 hex digits
# 100 tags, 100 * 100 commits: 8 hex digits
FILE=foo
touch ${FILE}
for i in `seq 1 10`; do
    echo ${i} >> ${FILE}
    git add ${FILE}
    git commit -m "Tag update number ${i} to ${FILE}"
    git tag -m "Version 1.0.${i}" -a 1.0.${i}
    for j in `seq 1 10`; do
        echo ${i}-${j} >> ${FILE}
        git add ${FILE}
        git commit -m "Update number ${i}-${j} to ${FILE}"
    done
done
```

[-- Attachment #2: Type: text/html, Size: 1900 bytes --]

             reply	other threads:[~2018-08-03 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 11:16 Martin Mosegaard Amdisen [this message]
2018-08-03 12:20 ` Bug: git-describe abbrev documentation mentions wrong default Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAVPhBmg1=dhGPougT2fXPdA+ogenrS8T3YhbpwzTfurxcn+HA@mail.gmail.com' \
    --to=martinmosegaard@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).