git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [bug] Multiline value should error if the next line is section

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
May 6, 2018, 20:03 UTC
Message-ID
<CAN0heSooYuGkxP9u0Uuwu_TCEOd_pj20L05=bwwHynPOapej6g@mail.gmail.com>
In-Reply-To
<20180507020348.31b473b4@kilabit.info>
Hi Shulhan
Thank you for your report. I'm abbreviating a bit:
On 6 May 2018 at 21:03, Shulhan <ms@kilabit.info> wrote:
Show 12 quoted lines
> [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?

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

Martin
Previous: ShulhanNext: brian m. carlson
Message 2 of 5 in “[bug] Multiline value should error if the next line is section”
  1. ShulhanMay 6, 2018
  2. Martin ÅgrenMay 6, 2018
  3. brian m. carlsonMay 6, 2018
  4. ShulhanMay 6, 2018
  5. SZEDER GáborMay 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.