From: Matheus Tavares <matheus.bernardino@usp.br>
To: gitster@pobox.com
Cc: git@vger.kernel.org, avarab@gmail.com
Subject: [PATCH v2 0/3] checkout: fix two bugs on count of updated entries
Date: Thu, 14 Jul 2022 08:49:09 -0300 [thread overview]
Message-ID: <cover.1657799213.git.matheus.bernardino@usp.br> (raw)
In-Reply-To: <cover.1657685948.git.matheus.bernardino@usp.br>
Changed since v1: small simplification at test t2080, to use
test_oid_to_path and test_stdout_line_count.
v1 cover letter:
This fixes two issues at the "Updated %d path from the index" report at
the end of a `git checkout <paths>` operation:
- Delayed checkout entries being counted twice.
- Failed entries being included in the count.
The first two patches add tests and the third implements the fix. I came
across this while working at parallel checkout, but only managed to get
back to it now.
Matheus Tavares (3):
checkout: document bug where delayed checkout counts entries twice
checkout: show bug about failed entries being included in final report
checkout: fix two bugs on the final count of updated entries
builtin/checkout.c | 2 +-
convert.h | 6 +++-
entry.c | 34 +++++++++++---------
entry.h | 3 +-
parallel-checkout.c | 10 ++++--
parallel-checkout.h | 4 ++-
t/lib-parallel-checkout.sh | 6 +++-
t/t0021-conversion.sh | 22 +++++++++++++
t/t2080-parallel-checkout-basics.sh | 48 +++++++++++++++++++++++++++++
unpack-trees.c | 2 +-
10 files changed, 113 insertions(+), 24 deletions(-)
Range-diff against v1:
1: 694aeb19f5 = 1: 694aeb19f5 checkout: document bug where delayed checkout counts entries twice
2: 8da18a0a8c ! 2: 4541e90224 checkout: show bug about failed entries being included in final report
@@ t/t2080-parallel-checkout-basics.sh: test_expect_success SYMLINKS 'parallel chec
+ git commit -m files &&
+
+ a_blob="$(git rev-parse :parallel-ineligible.a)" &&
-+ dir="$(echo "$a_blob" | cut -c 1-2)" &&
-+ file="$(echo "$a_blob" | cut -c 3-)" &&
-+ rm ".git/objects/$dir/$file" &&
++ rm .git/objects/$(test_oid_to_path $a_blob) &&
+ rm *.a *.b &&
+
+ test_checkout_workers 2 test_must_fail git checkout . 2>err &&
@@ t/t2080-parallel-checkout-basics.sh: test_expect_success SYMLINKS 'parallel chec
+ # - parallel-*.a: the blob will be missing
+ #
+ grep "Updated 3 paths from the index" err &&
-+ test "$(ls *.b | wc -l)" -eq 3 &&
-+ test "$(ls *.a | wc -l)" -eq 0
++ test_stdout_line_count = 3 ls *.b &&
++ ! ls *.a
+ )
+'
+
3: 5e9452be66 = 3: b182d74e96 checkout: fix two bugs on the final count of updated entries
--
2.37.0
next prev parent reply other threads:[~2022-07-14 11:49 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
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 ` Matheus Tavares [this message]
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=cover.1657799213.git.matheus.bernardino@usp.br \
--to=matheus.bernardino@usp.br \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).