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

Re: Git Test Coverage Report (Thursday, May 30th)

From
BRBarret Rhoden <brho@google.com>
Date
Jun 4, 2019, 20:41 UTC
Message-ID
<09bc8c7a-bab5-7cdb-75dc-f7c45a4dbaf8@google.com>
In-Reply-To
<9ab619bb-9deb-4e57-a3ad-9e996425b783@google.com>
Hi -
On 6/4/19 12:38 PM, Barret Rhoden wrote:
> I'll try to come up with a test, independent of my blame-ignore work, 
> that can get in that block.

I have a test that covers blame_coalesce(), which works both with and without my blame-ignore commit that started this thread.

However, the only thing we are really testing is that git blame didn't crash. There is no detectable change to the output. AFAIK, blame_coalesce() is a performance enhancement.

If you all are interested in that sort of test, I can put it in a patch. 
  Right now, I have this (below).
Thanks,
Barret
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index c92a47b6d5b1..4c652b85a55b 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -275,4 +275,32 @@ test_expect_success 'blame file with CRLF 
core.autocrlf=true' '
  	grep "A U Thor" actual
  '

+test_expect_success 'blame coalesce' '
+	cat >giraffe <<-\EOF &&
+	ABC
+	DEF
+	EOF
+	git add giraffe &&
+	git commit -m "original file" &&
+	
+	cat >giraffe <<-\EOF &&
+	ABC
+	XXX
+	DEF
+	EOF
+	git add giraffe &&
+	git commit -m "interior XXX line" &&
+	
+	cat >giraffe <<-\EOF &&
+	ABC
+	DEF
+	EOF
+	git add giraffe &&
+	git commit -m "same contents as original" &&
+
+	git blame giraffe &&
+
+	true
+'
+
  test_done
Previous: Barret RhodenNext: Derrick Stolee
Message 9 of 11 in “Git Test Coverage Report (Thursday, May 30th)”
  1. Derrick StoleeMay 30, 2019
  2. Derrick StoleeMay 30, 2019
  3. Derrick StoleeMay 31, 2019
  4. Johannes SchindelinMay 31, 2019
  5. Michael PlatingsJun 1, 2019
  6. Barret RhodenJun 3, 2019
  7. Derrick StoleeJun 3, 2019
  8. Barret RhodenJun 4, 2019
  9. Barret RhodenJun 4, 2019
  10. Derrick StoleeJun 5, 2019
  11. Barret RhodenJun 10, 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.