{"thread":{"id":"42615","subject":"bug: compactionheuristic config var case issue","startedAt":"2016-06-16T06:55:53Z","lastAt":"2016-06-16T09:48:39Z","messageCount":3,"participants":["Brian Lalor","Duy Nguyen","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"289285","messageId":"8C006106-EED2-48B5-B9A5-6FCEB64597C1@bravo5.org","threadId":"42615","inReplyTo":null,"subject":"bug: compactionheuristic config var case issue","fromName":"Brian Lalor","fromEmail":"blalor@bravo5.org","sentAt":"2016-06-15T10:39:32Z","receivedAt":"2016-06-16T06:55:53Z","isPatch":false,"sender":{"key":"blalor@bravo5.org","avatar":null},"body":"I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!  \n\nThe config option in the documentation references “diff.compactionHeuristic”, but diff.c does a case-sensitive comparison on “diff.compactionheuristic” (note the case of the “h” in “heuristic”) and `git diff` does not honor the config.  Confusingly, `git config diff.compactionheuristic` returns true when diff.compactionHeuristic is set in ~/.gitconfig.  When diff.compactionheuristic is set to true in ~/.gitconfig, the desired behavior is achieved.\n\nThank you all for Git: it’s hard to remember the terrible world we lived in before it existed. :-)"},{"id":"289290","messageId":"CACsJy8Dp_s9avkkA4x=EfTjkObBNF8sB3zhkdgXmjkipDNdvNw@mail.gmail.com","threadId":"42615","inReplyTo":"8C006106-EED2-48B5-B9A5-6FCEB64597C1@bravo5.org","subject":"Re: bug: compactionheuristic config var case issue","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-06-15T12:33:31Z","receivedAt":"2016-06-16T06:55:53Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Jun 15, 2016 at 5:39 PM, Brian Lalor <blalor@bravo5.org> wrote:\n> I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!\n>\n> The config option in the documentation references “diff.compactionHeuristic”, but diff.c does a case-sensitive comparison on “diff.compactionheuristic” (note the case of the “h” in “heuristic”)\n\nI think this misled you. All configuration variable names are\nlower-cased before they reach that strcmp() call, the whole picture is\nmore like strcmp(tolower(var), \"diff.compactionheuristic\"), which I\nbelieve is correct.\n\n> and `git diff` does not honor the config.  Confusingly, `git config diff.compactionheuristic` returns true when diff.compactionHeuristic is set in ~/.gitconfig.  When diff.compactionheuristic is set to true in ~/.gitconfig, the desired behavior is achieved.\n>\n> Thank you all for Git: it’s hard to remember the terrible world we lived in before it existed. :-)\n-- \nDuy\n"},{"id":"289347","messageId":"20160616094815.GH15851@sigill.intra.peff.net","threadId":"42615","inReplyTo":"CACsJy8Dp_s9avkkA4x=EfTjkObBNF8sB3zhkdgXmjkipDNdvNw@mail.gmail.com","subject":"Re: bug: compactionheuristic config var case issue","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-06-16T09:48:16Z","receivedAt":"2016-06-16T09:48:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 15, 2016 at 07:33:31PM +0700, Duy Nguyen wrote:\n\n> On Wed, Jun 15, 2016 at 5:39 PM, Brian Lalor <blalor@bravo5.org> wrote:\n> > I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!\n> >\n> > The config option in the documentation references\n> > “diff.compactionHeuristic”, but diff.c does a case-sensitive\n> > comparison on “diff.compactionheuristic” (note the case of the “h”\n> > in “heuristic”)\n> \n> I think this misled you. All configuration variable names are\n> lower-cased before they reach that strcmp() call, the whole picture is\n> more like strcmp(tolower(var), \"diff.compactionheuristic\"), which I\n> believe is correct.\n\nYep, that is correct. Config keys are case-insensitive (except for the\nmiddle portion \"Y\" of a key like \"X.Y.Z\"), and the downcasing happens\nbefore they even hit the config callbacks.\n\n> > and `git diff` does not honor the config.  Confusingly, `git config\n> > diff.compactionheuristic` returns true when diff.compactionHeuristic\n> > is set in ~/.gitconfig.  When diff.compactionheuristic is set to\n> > true in ~/.gitconfig, the desired behavior is achieved.\n\nBrian, do you have a case you can share where it is not working as\nexpected?\n\nConfig isn't enabled automatically for plumbing commands like diff-tree.\nSo some commands may not respect it, but \"git diff\" definitely should.\n\n-Peff\n"}]}