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

Re: [PATCH] Use an intermediate file between between git blame and sed to avoid git blame's exit code being hidden.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2019, 22:41 UTC
Message-ID
<xmqqy321rw4t.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190616190202.GA15262@archbookpro.localdomain>
Denton Liu <liu.denton@gmail.com> writes:
Show 6 quoted lines
> For yours, I would reword your commit message to something like
>
> 	t8014: avoid git command in upstream pipe
> 	
> 	Use an intermediate file between between git blame and sed to avoid
> 	git blame's exit code being hidden.

I agree that the main "points" of this patch that should be highlighted on the title line are that it is about a test, and it is about not hiding a failure of a Git command by placing it on the upstream side of a pipe---the above title is very nicely written.

Show 6 quoted lines
>> +	"git blame -M9 --ignore-rev $IGNOREME $i >output &&
>> +	sed -e \"$pick_author\" <output >actual &&
>
> We should take advantage of the fact that sed can open its own input
> here. So we should drop the `<` and just pass the filename to sed. Same
> applies to the below.

While I do not think it matters too much in this case, I agree it is a good habit to get into, because it would give the command a chance to produce a better error diagnosis (i.e. "malformed input on line X" vs "malformed input on line X in file F"), when it wants to report an error in input, if we give the name of the file to open to the command instead of an already-open file descriptor, for one thing.

Previous: Michael Platings
Message 4 of 4 in “Use an intermediate file between between git blame and sed to avoid git blame's exit code being hidden.”
  1. Use an intermediate file between between git blame and sed to avoid git blame's exit code being hidden.michael@platin.gs, Jun 15, 2019
  2. Denton LiuJun 16, 2019
  3. Michael PlatingsJun 16, 2019
  4. Junio C HamanoJun 16, 2019

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.