git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug Report: Multi-line trailers containing empty lines break parsing
@ 2021-02-15 21:54 Matthias Buehlmann
  2021-02-16  2:29 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Matthias Buehlmann @ 2021-02-15 21:54 UTC (permalink / raw)
  To: git

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

    create a file containing multiline trailer:

    $ echo "Test" > test.txt
    $ git interpret-trailers --where end --if-exists addIfDifferent
--trailer "SingleLineTrailer: This is a single line trailer"
--in-place test.txt
    $ git interpret-trailers --where end --if-exists addIfDifferent
--trailer "MultiLineTrailer: This is"$'\n a folded multi-line\n
trailer' --in-place test.txt

    parse trailers:

    $ git interpret-trailers --parse test.txt
    SingleLineTrailer: This is a single line trailer
    MultiLineTrailer: This is a folded multi-line trailer

    (so far, all is as expected)

    now, adding multiline trailer containing empty line:

    $ git interpret-trailers --where end --if-exists addIfDifferent
--trailer "MultiLineTrailer: This is"$'\n a folded multi-line\n
trailer which\n \n contains an\n empty line' --in-place test.txt

    parse trailers again:

    $ git interpret-trailers --parse test.txt

What did you expect to happen? (Expected behavior)

I would expect the following output:

    $ git interpret-trailers --parse test.txt
    SingleLineTrailer: This is a single line trailer
    MultiLineTrailer: This is a folded multi-line trailer
    MultiLineTrailer: This is a folded multi-line trailer which
contains an empty line

What happened instead? (Actual behavior)

    no output is generated, but exit code is nevertheless 0:

    $ git interpret-trailers --parse test.txt
    $ echo $?
    0

What's different between what you expected and what actually happened?

    I would expect either to get an output or the call to exit non-zero

Anything else you want to add:

    According to my interpretation of the documentation of git
intepret-trailers, empty lines should be supported if properly folded,
in the same way as for example the PGP signature added to the commit
header contains a (properly folded) empty line

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.30.0.windows.2
cpu: x86_64
built from commit: f8cbc844b81bf6b9e72178bbe891a86c8bf5e9e7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
uname: Windows 10.0 18363
compiler info: gnuc: 10.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]
post-commit

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-03-26 10:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).