Re: [PATCH v3 3/4] parse_commit(): handle broken whitespace-only timestamp
- From
Jeff King <peff@peff.net>
- Date
- Apr 27, 2023, 16:46 UTC
- Message-ID
- <20230427164611.GA1976451@coredump.intra.peff.net>
- In-Reply-To
- <ad4f927f-607a-5391-ce50-a342d09934d6@gmail.com>
On Thu, Apr 27, 2023 at 12:55:26PM +0100, Phillip Wood wrote:
Show 15 quoted lines
> On 27/04/2023 11:11, Phillip Wood wrote: > > > > + test_commit 1234567890 && > > > + git cat-file commit HEAD >commit.orig && > > > + sed "s/>.*/> /" <commit.orig >commit.munge && > > > + ws_commit=$(git hash-object --literally -w -t commit > > > commit.munge) && > > > + sed "s/>.*/> $(printf "\013")/" <commit.orig >commit.munge && > > > > Does the shell eat the '\v' when it trims trailing whitespace from the > > command substitution (I can't remember the rules off the top of my > > head)? > > Having looked it up, the shell trims newlines but not other whitespace so > this should be fine.
Yep. I also wondered if some sed versions might complain. But it's really not that much more exotic than a tab, so it's probably OK.
-Peff