All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	git@vger.kernel.org, "Taylor Blau" <me@ttaylorr.com>
Subject: Re: ab/fsck-unexpected-type (and "cat-file replace handling and optimization")
Date: Thu, 7 Oct 2021 22:25:50 -0400	[thread overview]
Message-ID: <YV+sLmlWufC5ullA@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq8rz4pldt.fsf@gitster.g>

On Thu, Oct 07, 2021 at 02:37:02PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I don't mind rebasing on top if that's easier for Junio, but in that
> > case it may make sense to float the test cleanup to the front of the
> > series.
> 
> Yeah, I would rather not to see such a rebase (and I hate the kind
> of churns we seem to be allowing more and more in our codebase that
> causes needless textual conflicts.  We should really slow down and
> make fewer pointless "clean-up" that disrupts real work).

In this case I think neither is churn. I needed to clean up the earlier
part of the test script so that my later tests didn't break, and Ævar
touched the same area to cover more cases in those tests.

> > - test_expect_success 'cat-file -t and -s on corrupt loose object' '
> > - 	git init --bare corrupt-loose.git &&
> > - 	(
> > - 		cd corrupt-loose.git &&
> > ...
> > - 		test_must_fail git fsck 2>err.fsck &&
> > - 		grep "^error: inflate: data stream error (" err.fsck
> > - 	)
> 
> ... what's this lossage of the whole new test?

Whoops, indeed. I was little too anxious in my editor and then read the
combined diff backwards. That test should obviously stay (it is new in
Ævar's series). It still appears in total in the combined diff, but of
course as a "+" on his side.

One other possible thing to do during the resolution is combine the
cleanup of both objects in a single test (since in Ævar's series, both
objects are created together).

I.e., throw away my side from both conflicts, and do this on top:

diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index 0f52ca9cc8..508a70d877 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -487,6 +487,11 @@ test_expect_success "Size of large broken object is correct when type is large"
 	test_cmp expect actual
 '
 
+test_expect_success 'clean up broken objects' '
+	rm .git/objects/$(test_oid_to_path $bogus_short_sha1) \
+	   .git/objects/$(test_oid_to_path $bogus_long_sha1)
+'
+
 test_expect_success 'cat-file -t and -s on corrupt loose object' '
 	git init --bare corrupt-loose.git &&
 	(

That makes the merge more evil, but the end result is perhaps a little
nicer for people reading it later.

Thanks for reading my proposed resolution so carefully. :)

-Peff

  reply	other threads:[~2021-10-08  2:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 23:44 What's cooking in git.git (Oct 2021, #01; Mon, 4) Junio C Hamano
2021-10-04 23:52 ` Taylor Blau
2021-10-05 16:01 ` ab/refs-errno-cleanup Ævar Arnfjörð Bjarmason
2021-10-05 16:47 ` hm/paint-hits-in-log-grep Ævar Arnfjörð Bjarmason
2021-10-05 17:07 ` ab/designated-initializers-more Ævar Arnfjörð Bjarmason
2021-10-05 20:47 ` ab/fsck-unexpected-type (and "cat-file replace handling and optimization") Ævar Arnfjörð Bjarmason
2021-10-05 22:01   ` Jeff King
2021-10-06  8:54     ` Ævar Arnfjörð Bjarmason
2021-10-07 21:37     ` Junio C Hamano
2021-10-08  2:25       ` Jeff King [this message]
2021-10-08 20:50         ` Junio C Hamano
2021-10-06 10:14 ` ab/make-sparse-for-real Ævar Arnfjörð Bjarmason
2021-10-06 10:17 ` ab/parse-options-cleanup & ab/align-parse-options-help & ab/help-config-vars Ævar Arnfjörð Bjarmason
2021-10-06 16:44   ` Junio C Hamano
2021-10-06 10:26 ` ab/refs-errno-cleanup & "errno" removal in the refs backend Ævar Arnfjörð Bjarmason

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=YV+sLmlWufC5ullA@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.