All of lore.kernel.org
 help / color / mirror / Atom feed
* bug: compactionheuristic config var case issue
@ 2016-06-15 10:39 Brian Lalor
  2016-06-15 12:33 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Lalor @ 2016-06-15 10:39 UTC (permalink / raw)
  To: git

I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!  

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”) 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.

Thank you all for Git: it’s hard to remember the terrible world we lived in before it existed. :-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: compactionheuristic config var case issue
  2016-06-15 10:39 bug: compactionheuristic config var case issue Brian Lalor
@ 2016-06-15 12:33 ` Duy Nguyen
  2016-06-16  9:48   ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2016-06-15 12:33 UTC (permalink / raw)
  To: Brian Lalor; +Cc: Git Mailing List

On Wed, Jun 15, 2016 at 5:39 PM, Brian Lalor <blalor@bravo5.org> wrote:
> I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!
>
> 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”)

I think this misled you. All configuration variable names are
lower-cased before they reach that strcmp() call, the whole picture is
more like strcmp(tolower(var), "diff.compactionheuristic"), which I
believe is correct.

> 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.
>
> Thank you all for Git: it’s hard to remember the terrible world we lived in before it existed. :-)
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: compactionheuristic config var case issue
  2016-06-15 12:33 ` Duy Nguyen
@ 2016-06-16  9:48   ` Jeff King
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff King @ 2016-06-16  9:48 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Brian Lalor, Git Mailing List

On Wed, Jun 15, 2016 at 07:33:31PM +0700, Duy Nguyen wrote:

> On Wed, Jun 15, 2016 at 5:39 PM, Brian Lalor <blalor@bravo5.org> wrote:
> > I’m very happy to see the new compaction heuristic option; it’s the way I always thought diffs should read!
> >
> > 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”)
> 
> I think this misled you. All configuration variable names are
> lower-cased before they reach that strcmp() call, the whole picture is
> more like strcmp(tolower(var), "diff.compactionheuristic"), which I
> believe is correct.

Yep, that is correct. Config keys are case-insensitive (except for the
middle portion "Y" of a key like "X.Y.Z"), and the downcasing happens
before they even hit the config callbacks.

> > 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.

Brian, do you have a case you can share where it is not working as
expected?

Config isn't enabled automatically for plumbing commands like diff-tree.
So some commands may not respect it, but "git diff" definitely should.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-16  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 10:39 bug: compactionheuristic config var case issue Brian Lalor
2016-06-15 12:33 ` Duy Nguyen
2016-06-16  9:48   ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.