bug: git format prints no final newline
- From
- Evan Benn <evanbenn@google.com>
- Date
- Nov 3, 2022, 03:14 UTC
- Message-ID
- <CAKz_xw2X+eapmASqG7V=RXehh7=LN24m+MJPn-wx80oZAZHBnQ@mail.gmail.com>
This command omits the final newline:
git log --format=format:"%H"
check with: `| tail | cat -A`
This command doesn't, but there is an extra newline between each line of course:
git log --format=format:"%H%n"
This seems to be intentional in the code, a newline is printed before each line except the first:
https://github.com/git/git/blob/master/log-tree.c#L664
It seems more correct to print a newline after every line, but the code is very hairy so I am keen to get any feedback before attempting that.
Thanks