git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shulhan <ms@kilabit.info>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [bug] Multiline value should error if the next line is section
Date: Mon, 7 May 2018 06:03:22 +0700	[thread overview]
Message-ID: <20180507060322.66b121bd@kilabit.info> (raw)
In-Reply-To: <CAN0heSooYuGkxP9u0Uuwu_TCEOd_pj20L05=bwwHynPOapej6g@mail.gmail.com>

On Sun, 6 May 2018 22:03:10 +0200
Martin Ågren <martin.agren@gmail.com> wrote:

> Hi Shulhan
> 
> Thank you for your report. I'm abbreviating a bit:
> 
> On 6 May 2018 at 21:03, Shulhan <ms@kilabit.info> wrote:
> > [alias]
> >         tree = --no-pager log --graph \
> >                 -n 20 \
> > [user]
> >         name = Shulhan
> >
> > (2) Run `git config -f git.config -l`
> >
> > The command print the following output,
> >
> > alias.tree=--no-pager log --graph -n 20 [user]
> > alias.name=Shulhan  
> 
> Small mistake, big consequences. :-)
> 
> This behavior looks correct to me, though. It seems very hard to me to
> second-guess what the user meant. For example, what if that third line
> contained a "="? Like:
> 
> [alias]
>         huh = !dd \
>               bs=1024 ...
> 
> Should Git guess that the backslash on the second line was a mistake?
> Or maybe not, because alias.bs = "1024 ..." would be a useless alias?

The context of multiline next value that I reported before was
about section, not variable.

> 
> I think such guessing would be theoretically possible, but especially
> if Git guesses wrong, that could be very frustrating to fight against.
> 

I'm not familiar with git config parser, obviously :), but checking
the start of next multiline value that start with '[' maybe not
impossible. Git should not guessed, but report error at the
offending line: either user forgot to enclosed the variable with
double quote or they missplace the backslash.

  parent reply	other threads:[~2018-05-06 23:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-06 19:03 [bug] Multiline value should error if the next line is section Shulhan
2018-05-06 20:03 ` Martin Ågren
2018-05-06 21:09   ` brian m. carlson
2018-05-06 23:03   ` Shulhan [this message]
2018-05-06 23:25     ` SZEDER Gábor

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20180507060322.66b121bd@kilabit.info \
    --to=ms@kilabit.info \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).