git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: milki <milki@rescomp.berkeley.edu>
Cc: Alex Vandiver <alex@chmrr.net>, git@vger.kernel.org
Subject: Re: git-config: case insensitivity for subsections
Date: Mon, 29 Aug 2011 11:58:19 -0400	[thread overview]
Message-ID: <20110829155819.GA756@sigill.intra.peff.net> (raw)
In-Reply-To: <20110829054240.GB94231@hal.rescomp.berkeley.edu>

On Sun, Aug 28, 2011 at 10:42:40PM -0700, milki wrote:

> A user gave me a link [1] to his git-config and I cannot correctly
> parse, for example, his alias.last.
> [...]
> [1] https://github.com/kergoth/homefiles/blob/master/.gitconfig#L67

Isn't his config somewhat broken?  It looks like this:

  last = "!f(){ since="$1"; shift; git lg --since=\"last $since\" "$@"; }; f"

Those interior double-quotes should all be backslash-escaped. I didn't
check, but git should interpret this as:

  !f(){ since=$1; shift; git lg --since="last $since" $@; }; f

which is probably not quite what he wanted (the quotes around $1 were
actually superfluous, but the ones around $@ are important).

That being said, I think it is intentional that the value is not just "a
single double-quoted chunk" but rather could consist of several quoted
(or unquoted) chunks concatenated together. What does your parser think
of:

  [foo]
    bar = "foo"bar"baz"

It should be:

  $ git config foo.bar
  foobarbaz

-Peff

  reply	other threads:[~2011-08-29 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  6:35 git-config: case insensitivity for subsections milki
2011-08-25 20:58 ` Jeff King
2011-08-25 21:32   ` Junio C Hamano
2011-08-25 21:39     ` Jeff King
2011-08-25 21:57   ` milki
2011-08-29  0:50     ` Alex Vandiver
2011-08-29  5:42       ` milki
2011-08-29 15:58         ` Jeff King [this message]
2011-08-29 16:47           ` Alex Vandiver

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=20110829155819.GA756@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=alex@chmrr.net \
    --cc=git@vger.kernel.org \
    --cc=milki@rescomp.berkeley.edu \
    /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).