git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Enabling the diff "indent" heuristic by default

From
Jeff King <peff@peff.net>
Date
May 9, 2017, 03:20 UTC
Message-ID
<20170509032034.zbdeu2xsawcm32xb@sigill.intra.peff.net>
In-Reply-To
<f867af6f-b601-251a-86a4-ede0bb942efb@xiplink.com>
On Mon, May 08, 2017 at 10:54:10AM -0400, Marc Branchaud wrote:
Show 15 quoted lines
> On 2017-05-08 03:48 AM, Junio C Hamano wrote:
> > 
> > * mb/diff-default-to-indent-heuristics (2017-05-02) 4 commits
> >   (merged to 'next' on 2017-05-08 at 158f401a92)
> 
> I think there's a general open question about this, which is whether or not
> we should just drop the diff.indentHeuristic configuration setting
> altogether.
> 
> Peff made the point [0] that if we keep the setting then t4061 should be
> rewritten.
> 
> My instinct is to keep the setting, at least until the changed default has a
> bit of time to settle in.  So I'll re-send the topic with the renovated
> t4061.

My instinct matches that, too. It gives people like Ævar, with his patch-id database, a way to keep compatibility if he chooses. If we were designing from the ground up, I'd say the option is probably just clutter, but the backwards compatibility issue means we should probably keep it around more or less forever.

And since Junio wasn't on the other thread, I'll repeat what I wrote there:

  I do feel a bit sad about breaking this case (or at the very least
  forcing you to set an option to retain cross-version compatibility).
  But my gut says that we don't want to lock ourselves into never
  changing the diff algorithm (and I'm sure we've done it inadvertently
  a few times over the years; even the recent switch to turning on
  renames would have had that impact).
Show 9 quoted lines
> Both Peff [1] and Ævar [2] mentioned situations where enabling the heuristic
> has a small impact on them.  If/when this graduates, it's perhaps worth
> adding a backward-compatibility note that the default patch IDs are
> changing.  Maybe something like:
> 
> The diff "indent" heuristic is now enabled by default.  This changes the
> patch IDs calculated by git-patch-id and used by git-cherry, which could
> affect patch-based workflows that rely on previously-computed patch IDs.
> The heuristic can be disabled by setting diff.indentHeuristic to false.
I think a note like this is a good idea.
-Peff
Previous: Jeff King
Message 14 of 14 in “What's cooking in git.git (May 2017, #02; Mon, 8)”
  1. Junio C HamanoMay 8, 2017
  2. Enabling the diff "indent" heuristic by defaultMarc Branchaud, May 8, 2017
  3. 0/4 Make diff plumbing commands respect the indentHeuristic.Marc Branchaud, May 8, 2017
  4. 1/4 diff: make the indent heuristic part of diff's basic configurationMarc Branchaud, May 8, 2017
  5. 4/4 add--interactive: drop diff.indentHeuristic handlingMarc Branchaud, May 8, 2017
  6. Jeff KingMay 9, 2017
  7. 2/4 diff: have the diff-* builtins configure diff before initializing revisionsMarc Branchaud, May 8, 2017
  8. Jeff KingMay 9, 2017
  9. Marc BranchaudMay 11, 2017
  10. 3/4 diff: enable indent heuristic by defaultMarc Branchaud, May 8, 2017
  11. Stefan BellerMay 8, 2017
  12. Jeff KingMay 9, 2017
  13. Jeff KingMay 9, 2017
  14. Jeff KingMay 9, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.