{"thread":{"id":"49015","subject":"Bug: git-describe abbrev documentation mentions wrong default","startedAt":"2018-08-03T11:16:41Z","lastAt":"2018-08-03T12:20:41Z","messageCount":2,"participants":["Martin Mosegaard Amdisen","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"354374","messageId":"CAAVPhBmg1=dhGPougT2fXPdA+ogenrS8T3YhbpwzTfurxcn+HA@mail.gmail.com","threadId":"49015","inReplyTo":null,"subject":"Bug: git-describe abbrev documentation mentions wrong default","fromName":"Martin Mosegaard Amdisen","fromEmail":"martinmosegaard@gmail.com","sentAt":"2018-08-03T11:16:26Z","receivedAt":"2018-08-03T11:16:41Z","isPatch":false,"sender":{"key":"martinmosegaard@gmail.com","avatar":null},"body":"The documentation for the \"git describe --abbrev\" flag says that the\ndefault value is 7 hexadecimal digits:\nhttps://github.com/git/git/blob/master/Documentation/git-describe.txt#L63\nand\nhttps://git-scm.com/docs/git-describe\n\nI have experienced that sometimes I see 7 digits, but other times more.\nThe behavior seems to have changed in git 2.11.0 (\"default abbreviation\nlength\"):\nhttps://github.com/git/git/blob/aeddbfdfa48443c034a9b28b10dfddf2f71b907f/Documentation/RelNotes/2.11.0.txt\n\nI was able to trigger different behavior using a bash script like the one\nbelow:\n\n```sh\n#!/bin/bash\n\nDIR=test-git-describe\nrm -rf ${DIR}\nmkdir ${DIR}\ncd ${DIR}\ngit init\n\n# One-time test results I have seen:\n# 10 tags, 10 * 10 commits: 7 hex digits\n# 100 tags, 100 * 100 commits: 8 hex digits\nFILE=foo\ntouch ${FILE}\nfor i in `seq 1 10`; do\n    echo ${i} >> ${FILE}\n    git add ${FILE}\n    git commit -m \"Tag update number ${i} to ${FILE}\"\n    git tag -m \"Version 1.0.${i}\" -a 1.0.${i}\n    for j in `seq 1 10`; do\n        echo ${i}-${j} >> ${FILE}\n        git add ${FILE}\n        git commit -m \"Update number ${i}-${j} to ${FILE}\"\n    done\ndone\n```\n"},{"id":"354377","messageId":"87a7q3tze3.fsf@evledraar.gmail.com","threadId":"49015","inReplyTo":"CAAVPhBmg1=dhGPougT2fXPdA+ogenrS8T3YhbpwzTfurxcn+HA@mail.gmail.com","subject":"Re: Bug: git-describe abbrev documentation mentions wrong default","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-08-03T12:20:36Z","receivedAt":"2018-08-03T12:20:41Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Aug 03 2018, Martin Mosegaard Amdisen wrote:\n\n> The documentation for the \"git describe --abbrev\" flag says that the\n> default value is 7 hexadecimal digits:\n> https://github.com/git/git/blob/master/Documentation/git-describe.txt#L63\n> and\n> https://git-scm.com/docs/git-describe\n>\n> I have experienced that sometimes I see 7 digits, but other times more.\n> The behavior seems to have changed in git 2.11.0 (\"default abbreviation\n> length\"):\n> https://github.com/git/git/blob/aeddbfdfa48443c034a9b28b10dfddf2f71b907f/Documentation/RelNotes/2.11.0.txt\n>\n> I was able to trigger different behavior using a bash script like the one\n> below:\n>\n> ```sh\n> #!/bin/bash\n>\n> DIR=test-git-describe\n> rm -rf ${DIR}\n> mkdir ${DIR}\n> cd ${DIR}\n> git init\n>\n> # One-time test results I have seen:\n> # 10 tags, 10 * 10 commits: 7 hex digits\n> # 100 tags, 100 * 100 commits: 8 hex digits\n> FILE=foo\n> touch ${FILE}\n> for i in `seq 1 10`; do\n>     echo ${i} >> ${FILE}\n>     git add ${FILE}\n>     git commit -m \"Tag update number ${i} to ${FILE}\"\n>     git tag -m \"Version 1.0.${i}\" -a 1.0.${i}\n>     for j in `seq 1 10`; do\n>         echo ${i}-${j} >> ${FILE}\n>         git add ${FILE}\n>         git commit -m \"Update number ${i}-${j} to ${FILE}\"\n>     done\n> done\n> ```\n\nYeah this is a documentation bug, and as you note it's describing old\nbehavior we no longer have. I was on the fence about whether I should\nfix this in my WIP 20 patch monster over at\nhttps://public-inbox.org/git/20180608224136.20220-1-avarab@gmail.com/\n(which I need to re-roll), but I no longer am, I'll track down these\noccurances in the docs and fix them, as I recall there's around 5-10 of\nthem in various places.\n"}]}