git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ciaran <ciaranj@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH RFC] Rename detection and whitespace
Date: Wed, 20 Apr 2011 02:03:44 -0400	[thread overview]
Message-ID: <20110420060343.GD28597@sigill.intra.peff.net> (raw)
In-Reply-To: <BANLkTikiH7bfWFGjFCDL-SnO9HQR-9Uofw@mail.gmail.com>

On Tue, Apr 19, 2011 at 09:13:19PM +0100, Ciaran wrote:

> For me I tracked the behaviour down to the blob similarity calculation
> that takes place in the diffcore-delta.c#hash_chars method.  In our
> case the problem was we were adjusting the whitespace at the front of
> each line which meant that the 64 byte segment hashes were
> different/mis-aligned between the 2 equivalent files.   This code
> already 'normalises' out CRLF/LF differences by skipping any CR
> characters when followed by LF so my question is that would it be
> considered wrong/evil to ignore *all* whitespace characters when -X
> ignore-all-space has been passed.

I think what you are proposing makes sense. If the diff which spawned
the rename detection doesn't care about whitespace, then probably it
should be ignored in the rename, too. That would go for merging with "-X
ignore-all-space", but also for "git diff -w" (and probably "-b").

I do think it should be conditional on those, though. We _know_ that
CRLF versus LF in a text file is irrelevant to the file's content. But
whether whitespace is irrelevant varies from file to file.

So your patch is in the right direction, in my opinion.

-Peff

      reply	other threads:[~2011-04-20  6:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 20:13 [PATCH RFC] Rename detection and whitespace Ciaran
2011-04-20  6:03 ` Jeff King [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110420060343.GD28597@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=ciaranj@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).