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

Re: [PATCH v3 5/5] blame: add tests for ignoring revisions

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 13, 2019, 23:31 UTC
Message-ID
<xmqqef8b9sfc.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190212222722.240676-6-brho@google.com>
Barret Rhoden <brho@google.com> writes:
> +	git rev-parse Y > expect &&

Not limited to this one, but lose the SP between the redirection operator and its target pathname, i.e. "git rev-parse Y >expect".

> +	sed -i -e "s/[0-9a-f]/0/g" expect &&
Don't use "sed -i" in-place rewrite, that is not portable.

In the meantime, I'd patch it up with this so that we can keep 'pu' working. Placing "git rev-parse" upstream of a pipe is not kosher, but in the meantime...

 t/t8013-blame-ignore-revs.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh
index 3a4ad7cf93..e3396a78d0 100755
--- a/t/t8013-blame-ignore-revs.sh
+++ b/t/t8013-blame-ignore-revs.sh
@@ -57,8 +57,7 @@ test_expect_success ignore_rev_adding_lines '
 	git commit -m Y &&
 	git tag Y &&
 
-	git rev-parse Y > expect &&
-	sed -i -e "s/[0-9a-f]/0/g" expect &&
+	git rev-parse Y | sed -e "s/[0-9a-f]/0/g" >expect &&
 	git blame --line-porcelain file --ignore-rev Y > blame_raw &&
 
 	grep "^[0-9a-f]\+ 3 3" blame_raw | sed -e "s/ .*//" > actual &&
Previous: Barret RhodenNext: Barret Rhoden
Message 7 of 8 in “blame: add the ability to ignore commits”
  1. 0/5 blame: add the ability to ignore commitsBarret Rhoden, Feb 12, 2019
  2. 1/5 Move init_skiplist() outside of fsckBarret Rhoden, Feb 12, 2019
  3. 2/5 blame: use a helper function in blame_chunk()Barret Rhoden, Feb 12, 2019
  4. 3/5 blame: add the ability to ignore commits and their changesBarret Rhoden, Feb 12, 2019
  5. 4/5 blame: add a config option to mark ignored linesBarret Rhoden, Feb 12, 2019
  6. 5/5 blame: add tests for ignoring revisionsBarret Rhoden, Feb 12, 2019
  7. Junio C HamanoFeb 13, 2019
  8. 5/5 blame: add tests for ignoring revisionsBarret Rhoden, Feb 14, 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.