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

Re: [PATCH] rev-parse --show-prefix: add in trailing newline

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Apr 10, 2012, 14:41 UTC
Message-ID
<m2vcl7ir86.fsf@igel.home>
In-Reply-To
<7v1unwwwov.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Because the assignment will strip the trailing LF away
No, it doesn't.  Command substitution does.
Show 5 quoted lines
> But it will break existing scripts if they expect the following to work:
>
> 	file="$(git rev-parse --show-prefix)/$1"
>         cd_to_toplevel
>         test -f "$file"
This is already broken because of the extra slash.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Jonathan NiederNext: Junio C Hamano
Message 5 of 9 in “rev-parse --show-prefix: add in trailing newline”
  1. rev-parse --show-prefix: add in trailing newlineRoss Lagerwall, Apr 9, 2012
  2. Junio C HamanoApr 9, 2012
  3. Ross LagerwallApr 10, 2012
  4. Jonathan NiederApr 10, 2012
  5. Andreas SchwabApr 10, 2012
  6. Junio C HamanoApr 10, 2012
  7. Jonathan NiederApr 10, 2012
  8. Junio C HamanoApr 10, 2012
  9. Nguyen Thai Ngoc DuyApr 10, 2012

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.