Re: [PATCH v2] diff: handle --no-abbrev outside of repository

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

 



On Mon, Dec 05, 2016 at 01:01:16AM -0500, Jeff King wrote:

>   Note that setting abbrev to "0" outside of a repository was broken
>   recently by 4f03666ac (diff: handle sha1 abbreviations outside of
>   repository, 2016-10-20). It adds a special out-of-repo code path for
>   handling abbreviations which behaves differently than find_unique_abbrev()
>   by truly giving a zero-length sha1, rather than taking "0" to mean "do
>   not abbreviate".
> 
>   That bug was not triggerable until now, because there was no way to
>   set the value to zero (using --abbrev=0 silently bumps it to the
>   MINIMUM_ABBREV).

Actually, I take this last paragraph back. You _can_ trigger the bug
with just:

  echo one >foo
  echo two >bar
  git diff --no-index --raw foo bar

which prints only "..." for each entry.

I didn't notice it before because without "--raw", we show the patch
format. That uses the --full-index option, and does not respect --abbrev
at all (which seems kind of bizarre, but has been that way forever).

So I think there _is_ a regression in v2.11, and the second half of your
change fixes it.

-Peff



[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]