git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Michal Privoznik <mprivozn@redhat.com>, git@vger.kernel.org
Subject: Re: [PATCH] config: Introduce --patience config variable
Date: Tue, 06 Mar 2012 18:57:42 -0800	[thread overview]
Message-ID: <7vlindp17d.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120306114914.GB6733@sigill.intra.peff.net> (Jeff King's message of "Tue, 6 Mar 2012 06:49:14 -0500")

Jeff King <peff@peff.net> writes:

> On Tue, Mar 06, 2012 at 11:59:42AM +0100, Michal Privoznik wrote:
>
>> Some users like the patience diff more than the bare diff. However,
>> specifying the '--patience' argument every time diff is to be used
>> is impractical. Moreover, creating an alias doesn't play with other
>> tools nice, e.g. git-show; Therefore we need a configuration variable
>> to turn this on/off across whole git tools.
>
> The idea of turning on patience diff via config makes sense to me, and
> it is not a problem for plumbing tools to have patience diff on, since
> patience diffs are syntactically identical to non-patience diffs.

Even though I do not strongly object to the general conclusion, I
have to point out that the last line above is a dangerous thought.

If you change the default diff algorithm, you will invalidate long
term caches that computed their keys based on the shape of patches
produced in the past.  The prime example being the rerere database,
but I wouldn't be surprised if somebody has a notes tree to record
patch ids for existing commits to speed up "git cherry" (hence "git
rebase").  Also kup tool kernel.org folks use to optimize the
uploading of inter-release diff relies on having a stable output
from "git diff A..B", so that the uploader can run the command to
produce a diff locally, GPG sign it, and upload only the signature
and have the k.org side produce the same diff between two tags,
without having to upload the huge patchfile over the wire.

IOW, "syntactically identical so it is OK" is not the right thought
process.  "It may change the shape of the patch, which is a potential
problem for various tools, but as long as users understand that, it
should be allowed." is OK.

Cached patch-id database for "git cherry" would be a local and does
not affect the correctness, so I would consider breaking it is fine.

About kup use case, the potential problem can be worked around as
long as the receiving end keeps the setting vanilla (and I do not
see any reason it wouldn't) and the uploader remembers to choose the
matching variant when he locally generates the patch, so I think it
would be also OK.

Unnecessarily invalidating rerere database may be more frustrating,
but that again is local and personal, so the end user may suffer
worse than cached patch-id use case, but that hopefully is just one
time pain.

My preference however is to limit this to Porcelains only, though.

  parent reply	other threads:[~2012-03-07  2:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 10:59 [PATCH] config: Introduce --patience config variable Michal Privoznik
2012-03-06 11:49 ` Jeff King
2012-03-06 13:01   ` Thomas Rast
2012-03-06 13:15     ` [PATCH 1/2] perf: compare diff algorithms Thomas Rast
2012-03-06 13:15       ` [PATCH 2/2] Document the --histogram diff option Thomas Rast
2012-03-06 19:57         ` Junio C Hamano
2012-03-06 20:42           ` Thomas Rast
2012-03-06 19:52       ` [PATCH 1/2] perf: compare diff algorithms Junio C Hamano
2012-03-06 21:00         ` Thomas Rast
2012-03-06 21:18           ` Junio C Hamano
2012-03-06 21:41             ` Jakub Narebski
2012-03-07 12:44               ` Thomas Rast
2012-03-07 17:45                 ` Junio C Hamano
2012-03-07 18:03                 ` Jakub Narebski
2012-03-07 18:19                   ` Junio C Hamano
2012-03-10  7:13       ` René Scharfe
2012-03-06 13:30     ` [PATCH] config: Introduce --patience config variable Jeff King
2012-03-06 13:32     ` Michal Privoznik
2012-03-06 13:38       ` Matthieu Moy
2012-03-06 14:09         ` Jeff King
2012-03-07  2:57   ` Junio C Hamano [this message]
2012-03-07 11:47     ` Jeff King
2012-03-07 17:24       ` Junio C Hamano

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=7vlindp17d.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mprivozn@redhat.com \
    --cc=peff@peff.net \
    /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).