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

Re: compactionHeuristic=true is not used by interactive staging

From
Jeff King <peff@peff.net>
Date
Jun 14, 2016, 21:42 UTC
Message-ID
<20160614214211.GB21560@sigill.intra.peff.net>
In-Reply-To
<CAEtHF9Na7yppEzuutp5=98KjLucgq=7Xv9GPidhaYEuC0oeqQQ@mail.gmail.com>
On Tue, Jun 14, 2016 at 04:22:54PM +0200, Alex Prengère wrote:
Show 10 quoted lines
> Hello,
> I just did a fresh clone of git from Github and installed the version
> 2.9.0 on Fedora 22.
> 
> I tried the new compactionHeuristic = true, which is awesome.
> The only thing that struck me was that this option was not used when
> doing an interactive staging, meaning `git diff` and `git add -p` will
> format patches differently. Perhaps this is intended and there is a
> way to force interactive staging to use specific diff options, but I
> did not find it in the doc.

That's because it's handled in the "UI config", and plumbing commands are not affected (and "add -p" is built on plumbing commands). The same is true of diff.algorithm, for instance.

To make this work, add--interactive would have to manually enable particular options that it thinks it can handle (and in fact this is done with diff.algorithm already). So we'd need a patch similar to 2cc0f53 (add--interactive: respect diff.algorithm, 2013-06-12).

Nobody noticed so far because originally the compaction heuristic was on by default, and so just worked everywhere. But we backed off on that at the last minute after finding a few cases where the diff looks worse.

-Peff
Previous: Alex PrengèreNext: Junio C Hamano
Message 2 of 7 in “compactionHeuristic=true is not used by interactive staging”
  1. Alex PrengèreJun 14, 2016
  2. Jeff KingJun 14, 2016
  3. Junio C HamanoJun 14, 2016
  4. Alex PrengèreJun 15, 2016
  5. add--interactive: respect diff.compactionHeuristicJeff King, Jun 16, 2016
  6. Stefan BellerJun 16, 2016
  7. Jeff KingJun 16, 2016

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.