Re: git blame gives an ambiguous short revision
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:12
Julia Lawall [off-list ref] writes:
Using linux-next cloned today (July 1), I then checkout out the
revision 60d5c9f5b. The command
git blame drivers/staging/brcm80211/brcmfmac/wl_iw.c -L3675,3675
then gives:
60d5c9f5 (Julia Lawall 2011-04-01 16:23:42 +0200 3675) if (!iscan->iscan_ex_params_p) {
Then I try:
git show 60d5c9f5
which gives:
error: short SHA1 60d5c9f5 is ambiguous.
error: short SHA1 60d5c9f5 is ambiguous.
fatal: ambiguous argument '60d5c9f5': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions
If I give git blame the -l option, every thing is fine.Or you can use --abbrev to explicitly set the width; as the length necessary to make the abbreviated object names depends on the project, there is no good default. I think it should be an easy patch to add a post-processing phase after all lines are blamed to automatically compute an appropriate value of abbreviation to ensure the uniqueness, but the current blame output does not bother to do so.