{"thread":{"id":"45797","subject":"BUG: diff-{index,files,tree} (and git-gui) do not respect the diff.indentHeuristic config setting","startedAt":"2017-04-25T17:26:47Z","lastAt":"2017-04-25T21:27:09Z","messageCount":2,"participants":["Marc Branchaud","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"317819","messageId":"19607a03-71e0-440b-7213-64d25f6fa8da@xiplink.com","threadId":"45797","inReplyTo":null,"subject":"BUG: diff-{index,files,tree} (and git-gui) do not respect the diff.indentHeuristic config setting","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2017-04-25T17:21:09Z","receivedAt":"2017-04-25T17:26:47Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"So I have\n\n\tdiff.indentHeuristic = true\n\nand I noticed that git-gui was not using the heuristic.  This is because \ngit-gui uses diff-index, and that does not respect the config setting, \neven though it supports the --indent-heuristic option.\n\nAnd it looks like diff-files and diff-tree also have the same problem.\n\nI tried a couple of quick-n-dirty things to fix it in diff-index, \nwithout success, and I've run out of git-hacking tame, so all I can do \nfor now is throw out a bug report.\n\ndiff-index.c explicitly says \"no 'diff' UI options\" since 83ad63cfeb \n(\"diff: do not use configuration magic at the core-level\", 2006-07-08), \nso maybe this needs to be fixed in git-gui (and maybe elsewhere), but to \nme it feels like the diff-foo commands should respect the setting.\n\n(CC'ing Michael Haggerty, who added the heuristic.)\n\n(This is git v2.12.2.)\n\n\t\tM.\n"},{"id":"317861","messageId":"20170425212659.ds4vbj5fjcbyycpc@sigill.intra.peff.net","threadId":"45797","inReplyTo":"19607a03-71e0-440b-7213-64d25f6fa8da@xiplink.com","subject":"Re: BUG: diff-{index,files,tree} (and git-gui) do not respect the diff.indentHeuristic config setting","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-04-25T21:27:00Z","receivedAt":"2017-04-25T21:27:09Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 25, 2017 at 01:21:09PM -0400, Marc Branchaud wrote:\n\n> So I have\n> \n> \tdiff.indentHeuristic = true\n> \n> and I noticed that git-gui was not using the heuristic.  This is because\n> git-gui uses diff-index, and that does not respect the config setting, even\n> though it supports the --indent-heuristic option.\n> \n> And it looks like diff-files and diff-tree also have the same problem.\n> \n> I tried a couple of quick-n-dirty things to fix it in diff-index, without\n> success, and I've run out of git-hacking tame, so all I can do for now is\n> throw out a bug report.\n\nRight, this is intentional. Those commands are scriptable plumbing, and\nwe try to avoid surprising their callers with behavior-changing config.\n\nI could see an argument that the behavior change for this particular\noption is subtle enough that it any script caller would not need to\ncare. The resulting diff is syntactically identical, and it's not like\nGit makes promises about the exact diff algorithm it uses. We generally\ntend to err on the side of caution with plumbing, though (for instance,\nif you piped the result through patch-id, you'd probably get different\nresults with and without the config option set).\n\n> diff-index.c explicitly says \"no 'diff' UI options\" since 83ad63cfeb (\"diff:\n> do not use configuration magic at the core-level\", 2006-07-08), so maybe\n> this needs to be fixed in git-gui (and maybe elsewhere), but to me it feels\n> like the diff-foo commands should respect the setting.\n\nYes, if git-gui wants to respect the option, it needs to read the config\nand turn on the command-line option. That's what add--interactive does,\nfor example.\n\nIt's possible we could make this simpler with a catch-all \"allow diff\nui config\" command-line option. The effect is the same, but it makes\nthings simpler for the caller.\n\n-Peff\n"}]}