Revision ed58d8088b570e7629bfc94b87e433f05229ef3c authored by Jeff King on 06 January 2017, 04:18:08 UTC, committed by Junio C Hamano on 08 January 2017, 03:34:54 UTC
You can already ask blame for full sha1s with "-l" or with
"--abbrev=40". But for consistency with other parts of Git,
we should support "--no-abbrev".

Worse, blame already accepts --no-abbrev, but it's totally
broken. When we see --no-abbrev, the abbrev variable is set
to 0, which is then used as a printf precision. For regular
sha1s, that means we print nothing at all (which is very
wrong). For boundary commits we decrement it to "-1", which
printf interprets as "no limit" (which is almost correct,
except it misses the 39-length magic explained in the
previous commit).

Let's detect --no-abbrev and behave as if --abbrev=40 was
given.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9122983
History
File Mode Size
.gitignore -rw-r--r-- 22 bytes
Makefile -rw-r--r-- 1.7 KB
branches-- -rw-r--r-- 47 bytes
hooks--applypatch-msg.sample -rwxr-xr-x 478 bytes
hooks--commit-msg.sample -rwxr-xr-x 896 bytes
hooks--post-update.sample -rwxr-xr-x 189 bytes
hooks--pre-applypatch.sample -rwxr-xr-x 424 bytes
hooks--pre-commit.sample -rwxr-xr-x 1.6 KB
hooks--pre-push.sample -rwxr-xr-x 1.3 KB
hooks--pre-rebase.sample -rwxr-xr-x 4.8 KB
hooks--pre-receive.sample -rwxr-xr-x 544 bytes
hooks--prepare-commit-msg.sample -rwxr-xr-x 1.2 KB
hooks--update.sample -rwxr-xr-x 3.5 KB
info--exclude -rw-r--r-- 240 bytes
this--description -rw-r--r-- 73 bytes

back to top