git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Taylor Blau <me@ttaylorr.com>,
	Christian Couder <christian.couder@gmail.com>,
	git@vger.kernel.org,
	Matthias Buehlmann <Matthias.Buehlmann@mabulous.com>,
	Jonathan Tan <jonathantanmy@google.com>
Subject: Re: Bug Report: Multi-line trailers containing empty lines break parsing
Date: Tue, 16 Feb 2021 14:47:08 -0500	[thread overview]
Message-ID: <YCwhPG6RaAhU9ljg@nand.local> (raw)
In-Reply-To: <xmqqmtw3pzu3.fsf@gitster.c.googlers.com>

On Tue, Feb 16, 2021 at 11:39:00AM -0800, Junio C Hamano wrote:
> A few comments (not pointing out bugs, but just sharing
> observations).
>
>  - if the line before "trailer: single" were not an empty line but a
>    line with a single SP on it (which is is_blank_line()), would the
>    new logic get confused?

Oof. That breaks the new test, but it makes me worried about whether
this can be parsed without ambiguity. I think not, but here I'd defer to
Christian or Jonathan Tan.

>  - if the second "multi:" trailer did not have the funny blank line
>    before "_two", the expected output would still be "multi:"
>    followed by "one two three", iow, the line after the second
>    "multi: one" is a total no-op?  If we added many more " \n" lines
>    there, they are all absorbed and ignored?  It somehow feels wrong

That's definitely the outcome of this patch, but I agree it feels wrong.
I'm not sure that we define the behavior that strictly in
git-interpret-trailers(1), so we have some wiggle room, I guess.

Thanks,
Taylor

  reply	other threads:[~2021-02-16 19:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 21:54 Bug Report: Multi-line trailers containing empty lines break parsing Matthias Buehlmann
2021-02-16  2:29 ` Junio C Hamano
2021-02-16 18:07   ` Taylor Blau
2021-02-16 19:39     ` Junio C Hamano
2021-02-16 19:47       ` Taylor Blau [this message]
2021-03-23 15:17         ` Christian Couder
2021-03-23 17:39           ` Junio C Hamano
2021-03-25  7:53             ` Christian Couder
2021-03-25  9:33               ` ZheNing Hu
2021-03-25 18:16                 ` Junio C Hamano
2021-03-26 10:25                   ` ZheNing Hu
2021-03-25 18:08               ` Junio C Hamano

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=YCwhPG6RaAhU9ljg@nand.local \
    --to=me@ttaylorr.com \
    --cc=Matthias.Buehlmann@mabulous.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.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).