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

Re: [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic.

From
Jeff King <peff@peff.net>
Date
May 9, 2017, 03:27 UTC
Message-ID
<20170509032729.bhq6ui23c3p6oyz3@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kbLKQ0jS0xfQO1MSp5T2_m9dShx0oYeTDAjDdUcydm3uQ@mail.gmail.com>
On Mon, May 08, 2017 at 10:13:41AM -0700, Stefan Beller wrote:
Show 8 quoted lines
> > -test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
> > +test_expect_success 'diff: nice spaces with diff.indentHeuristic=true' '
> 
> Adding the '=true' seems weird to me (I'd think the true is implied,
> similar to C,
> where we do "if (!null_pointer)" instead of an explicit "!=null".
> However we do have these '=true' sprinkled all over the tests,
> so I guess it is a valid dialect in our test suite.

I think it's better to be explicit here. I think the original was less about "implied true", as it was making the assumption that the feature was off in the first place. Now that we've flipped that, just saying "diff.indentHeuristic" is unclear whether you mean the "implied true" of:

  git -c diff.indentHeuristic diff ...

or if you mean setting diff.indentHeuristic at all but aren't saying which (which I think is how the original meant it).

I dunno. I guess it is subjective, but IMHO the "=true" is much clearer.
-Peff
Previous: Stefan BellerNext: Jeff King
Message 12 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.