git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matheus Tavares <matheus.bernardino@usp.br>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] checkout: document bug where delayed checkout counts entries twice
Date: Wed, 13 Jul 2022 10:57:21 -0700	[thread overview]
Message-ID: <xmqqfsj4dhfi.fsf@gitster.g> (raw)
In-Reply-To: <694aeb19f57297d9b9d07d47897385bdbedd309c.1657685948.git.matheus.bernardino@usp.br> (Matheus Tavares's message of "Wed, 13 Jul 2022 01:19:55 -0300")

Matheus Tavares <matheus.bernardino@usp.br> writes:

> 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.

> +	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

  reply	other threads:[~2022-07-13 17:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  4:19 [PATCH 0/3] checkout: fix two bugs on count of updated entries Matheus Tavares
2022-07-13  4:19 ` [PATCH 1/3] checkout: document bug where delayed checkout counts entries twice Matheus Tavares
2022-07-13 17:57   ` Junio C Hamano [this message]
2022-07-13  4:19 ` [PATCH 2/3] checkout: show bug about failed entries being included in final report Matheus Tavares
2022-07-13 11:14   ` Ævar Arnfjörð Bjarmason
     [not found]     ` <CAHd-oW6AeOGv=zQ=9Udtzwau=5XbQkhuctVDa0=4PoMTSU20HQ@mail.gmail.com>
2022-07-13 13:00       ` Matheus Tavares
2022-07-13  4:19 ` [PATCH 3/3] checkout: fix two bugs on the final count of updated entries Matheus Tavares
2022-07-14 11:49 ` [PATCH v2 0/3] checkout: fix two bugs on " Matheus Tavares
2022-07-14 11:49   ` [PATCH v2 1/3] checkout: document bug where delayed checkout counts entries twice Matheus Tavares
2022-07-14 11:49   ` [PATCH v2 2/3] checkout: show bug about failed entries being included in final report Matheus Tavares
2022-07-14 11:49   ` [PATCH v2 3/3] checkout: fix two bugs on the final count of updated entries Matheus Tavares

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqfsj4dhfi.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).