From: Jeff King <peff@peff.net>
To: Jack Bates <bk874k@nottheoilrig.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jack Bates <jack@nottheoilrig.com>
Subject: Re: [PATCH v2] diff: handle --no-abbrev outside of repository
Date: Mon, 5 Dec 2016 01:15:00 -0500 [thread overview]
Message-ID: <20161205061500.dinyc3juedkpw6o3@sigill.intra.peff.net> (raw)
In-Reply-To: <20161205060116.szy5ojetg3znu4w7@sigill.intra.peff.net>
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
next prev parent reply other threads:[~2016-12-05 6:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 18:25 [PATCH] diff: handle --no-abbrev outside of repository Jack Bates
2016-11-28 23:03 ` Junio C Hamano
2016-11-29 7:06 ` Jeff King
2016-12-02 18:48 ` [PATCH v2] " Jack Bates
2016-12-05 6:01 ` Jeff King
2016-12-05 6:15 ` Jeff King [this message]
2016-12-05 6:58 ` Jeff King
2016-12-06 1:01 ` [PATCH v3] diff: handle --no-abbrev in no-index case Jack Bates
2016-12-06 16:53 ` [PATCH v4] " Jack Bates
2016-12-06 16:56 ` Jack Bates
2016-12-06 17:00 ` Jack Bates
2016-12-08 22:53 ` Junio C Hamano
2016-12-09 0:22 ` Jack Bates
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161205061500.dinyc3juedkpw6o3@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bk874k@nottheoilrig.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jack@nottheoilrig.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).