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

Re: [PATCH 1/3] checkout: document bug where delayed checkout counts entries twice

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2022, 17:57 UTC
Message-ID
<xmqqfsj4dhfi.fsf@gitster.g>
In-Reply-To
<694aeb19f57297d9b9d07d47897385bdbedd309c.1657685948.git.matheus.bernardino@usp.br>
Matheus Tavares <matheus.bernardino@usp.br> writes:
Show 22 quoted lines
> At the end of a `git checkout <pathspec>` operation, git reports how
> many paths were checked out with a message like "Updated N paths from
> the index". However, entries that end up on the delayed checkout queue
> (as requested by a long-running process filter) get counted twice,
> producing a wrong number in the final report. We will fix this bug in an
> upcoming commit. For now, only document/demonstrate it with a
> test_expect_failure.
>
> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
> ---
>  t/t0021-conversion.sh | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> index bad37abad2..00df9b5c18 100755
> --- a/t/t0021-conversion.sh
> +++ b/t/t0021-conversion.sh
> @@ -1132,4 +1132,26 @@ do
>  	'
>  done
>  
> +test_expect_failure PERL 'delayed checkout correctly reports the number of updated entries' '

It is unfortunate that we depend on Perl only to run rot13-filter; I'll leave a #leftoverbit label here to remind us to write a "test-tool rot13-filter" someday. No need to do so in this series.

Show 22 quoted lines
> +	rm -rf repo &&
> +	git init repo &&
> +	(
> +		cd repo &&
> +		git config filter.delay.process "../rot13-filter.pl delayed.log clean smudge delay" &&
> +		git config filter.delay.required true &&
> +
> +		echo "*.a filter=delay" >.gitattributes &&
> +		echo a >test-delay10.a &&
> +		echo a >test-delay11.a &&
> +		git add . &&
> +		git commit -m files &&
> +
> +		rm *.a &&
> +		git checkout . 2>err &&
> +		grep "IN: smudge test-delay10.a .* \\[DELAYED\\]" delayed.log &&
> +		grep "IN: smudge test-delay11.a .* \\[DELAYED\\]" delayed.log &&
> +		grep "Updated 2 paths from the index" err
> +	)
> +'
> +
>  test_done
Previous: Matheus TavaresNext: Matheus Tavares
Message 3 of 11 in “checkout: fix two bugs on count of updated entries”
  1. 0/3 checkout: fix two bugs on count of updated entriesMatheus Tavares, Jul 13, 2022
  2. 1/3 checkout: document bug where delayed checkout counts entries twiceMatheus Tavares, Jul 13, 2022
  3. Junio C HamanoJul 13, 2022
  4. 2/3 checkout: show bug about failed entries being included in final reportMatheus Tavares, Jul 13, 2022
  5. Ævar Arnfjörð BjarmasonJul 13, 2022
  6. 3/3 checkout: fix two bugs on the final count of updated entriesMatheus Tavares, Jul 13, 2022
  7. 0/3 checkout: fix two bugs on count of updated entriesMatheus Tavares, Jul 14, 2022
  8. 1/3 checkout: document bug where delayed checkout counts entries twiceMatheus Tavares, Jul 14, 2022
  9. 2/3 checkout: show bug about failed entries being included in final reportMatheus Tavares, Jul 14, 2022
  10. 3/3 checkout: fix two bugs on the final count of updated entriesMatheus Tavares, Jul 14, 2022
  11. Matheus TavaresJul 13, 2022

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.