git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Brian Lalor <blalor@bravo5.org>, Git Mailing List <git@vger.kernel.org>
Subject: Re: bug: compactionheuristic config var case issue
Date: Thu, 16 Jun 2016 05:48:16 -0400	[thread overview]
Message-ID: <20160616094815.GH15851@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8Dp_s9avkkA4x=EfTjkObBNF8sB3zhkdgXmjkipDNdvNw@mail.gmail.com>

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

      reply	other threads:[~2016-06-16  9:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160616094815.GH15851@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=blalor@bravo5.org \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).