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

Re: [PATCH] blame: use different author name for fake commit generated by --contents

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2023, 23:34 UTC
Message-ID
<xmqqbkjgizcv.fsf@gitster.g>
In-Reply-To
<20230421223013.467142-1-jacob.e.keller@intel.com>
Jacob Keller <jacob.e.keller@intel.com> writes:
> +test_expect_success 'blame working copy' '
> +	test_when_finished "git restore file" &&
> +	echo "1A quick brown fox jumps over" >file &&
> +	echo "another lazy dog" >> file &&

Lose the SP between ">>" redirection operator and its operand "file".

So, we have "1A quick brown fox jumps over the" and "lazy dog" in :file and HEAD:file, and both of these lines are different in the working tree files as shown above.

> +	check_count A 1 "Not Committed Yet" 1

So why do we expect one is attributed to A while the other is attributed to the working tree file? Shouldn't we be expecting both to be attributed to "Not Committed Yet"?

WIth this updated like the attached, 8001, 8002, and 8012 seem to all pass (and without, they all fail).

 t/annotate-tests.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git c/t/annotate-tests.sh w/t/annotate-tests.sh
index 859693949b..4238ce45f8 100644
--- c/t/annotate-tests.sh
+++ w/t/annotate-tests.sh
@@ -74,8 +74,8 @@ test_expect_success 'blame 1 author' '
 
 test_expect_success 'blame working copy' '
 	test_when_finished "git restore file" &&
-	echo "1A quick brown fox jumps over" >file &&
-	echo "another lazy dog" >> file &&
+	echo "11A quick brown fox jumps over the" >file &&
+	echo "lazy dog" >>file &&
 	check_count A 1 "Not Committed Yet" 1
 '
 
Previous: Jacob KellerNext: Jacob Keller
Message 2 of 6 in “blame: use different author name for fake commit generated by --contents”
  1. blame: use different author name for fake commit generated by --contentsJacob Keller, Apr 21, 2023
  2. Junio C HamanoApr 21, 2023
  3. Jacob KellerApr 22, 2023
  4. Junio C HamanoApr 24, 2023
  5. Glen ChooApr 24, 2023
  6. Jacob KellerApr 24, 2023

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.