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

Re: [PATCH] t4067: make rename detection test output raw diff

From
Derrick Stolee <stolee@gmail.com>
Date
May 19, 2020, 19:00 UTC
Message-ID
<f15b2d01-2486-57d5-d332-3214ae0609fa@gmail.com>
In-Reply-To
<20200519183151.46138-1-jonathantanmy@google.com>
On 5/19/2020 2:31 PM, Jonathan Tan wrote:
Show 21 quoted lines
> 95acf11a3d ("diff: restrict when prefetching occurs", 2020-04-07) taught
> diff to prefetch blobs in a more limited set of situations. These
> limited situations include when the output format requires blob data,
> and when inexact rename detection is needed.
> 
> There is an existing test case that tests inexact rename detection, but
> it also uses an output format that requires blob data, resulting in the
> inexact-rename-detection-only code not being tested. Update this test to
> use the raw output format, which does not require blob data.
> 
> Thanks to Derrick Stolee for noticing this lapse in code coverage and
> for doing the preliminary analysis [1].
> 
> [1] https://lore.kernel.org/git/853759d3-97c3-241f-98e1-990883cd204e@gmail.com/
> 
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> Thanks, Stolee. Yes, we were never in a situation where there are any
> missing objects at the point of inexact rename detection (despite having
> a test exactly for this), but this situation is possible, and I've
> updated the test so that we encounter this situation.
Thanks for finding the test bug!
Show 16 quoted lines
> ---
>  t/t4067-diff-partial-clone.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/t/t4067-diff-partial-clone.sh b/t/t4067-diff-partial-clone.sh
> index c1ed1c2fc4..ef8e0e9cb0 100755
> --- a/t/t4067-diff-partial-clone.sh
> +++ b/t/t4067-diff-partial-clone.sh
> @@ -125,8 +125,8 @@ test_expect_success 'diff with rename detection batches blobs' '
>  
>  	# Ensure that there is exactly 1 negotiation by checking that there is
>  	# only 1 "done" line sent. ("done" marks the end of negotiation.)
> -	GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff -M HEAD^ HEAD >out &&
> -	grep "similarity index" out &&
> +	GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD >out &&
> +	grep ":100644 100644.*R[0-9][0-9][0-9].*b.*c" out &&

--raw definitely does rename detection and I understand the need to adjust your grep command here.

Thanks, -Stolee

Previous: Jonathan TanNext: brian m. carlson
Message 7 of 16 in “Git Test Coverage Report (v2.27.0-rc0)”
  1. Derrick StoleeMay 15, 2020
  2. Derrick StoleeMay 19, 2020
  3. René ScharfeMay 19, 2020
  4. brian m. carlsonMay 19, 2020
  5. brian m. carlsonMay 20, 2020
  6. t4067: make rename detection test output raw diffJonathan Tan, May 19, 2020
  7. Derrick StoleeMay 19, 2020
  8. 1/1 builtin/checkout: simplify metadata initializationbrian m. carlson, May 20, 2020
  9. Junio C HamanoMay 20, 2020
  10. brian m. carlsonMay 20, 2020
  11. 0/2 Improve Fix code coverage for checkoutbrian m. carlson, May 21, 2020
  12. 1/2 builtin/checkout: simplify metadata initializationbrian m. carlson, May 21, 2020
  13. Junio C HamanoMay 21, 2020
  14. brian m. carlsonMay 23, 2020
  15. 2/2 t2060: add a test for switch with --orphan and --discard-changesbrian m. carlson, May 21, 2020
  16. Derrick StoleeMay 21, 2020

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.