Bug with --abbrev option in git log?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Git community,

please see next what I believe to be a bug with the  --abbrev option in git log.
If this is not a bug, can someone explain why Git is giving this output?

Thanks
Mário Guimarães

======================================================
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

In the Git repository run this command:

git log --raw -r -c --abbrev=6 --pretty=oneline -n1
a7144d4bc5ab58f306a1e5c73b27196fb999a63d

What did you expect to happen? (Expected behavior)

I was expecting to get this line in the output

::100644 100644 100644 639a41 111378 05ba1d MM Documentation/git-rebase.txt

What happened instead? (Actual behavior)

I got the following line instead

::100644 100644 100644 639a41 111378 05ba1d3 MM Documentation/git-rebase.txt

What's different between what you expected and what actually happened?

Since `--abbrev` is set to 6 the expected hash is `05ba1d` not `05ba1d3`.

Anything else you want to add:

If --abbrev is set to N then the size of all hashes should be the
first N hex digits.

The problem with `--abbrev` is more evident with values below 7. Try with 1, 2,
3, 4, and 5, to see for yourself.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.29.2
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52
PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
compiler info: clang: 12.0.0 (clang-1200.0.32.21)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
======================================================




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux