From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Nikolaus Schuetz via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org,
Nikolaus Schuetz <nikolauspschuetz@gmail.com>
Subject: Re: [PATCH] merge-base: add tests for --is-ancestor
Date: Wed, 29 Jul 2026 08:31:47 -0700 [thread overview]
Message-ID: <xmqqo6fpak2k.fsf@gitster.g> (raw)
In-Reply-To: <9a47d529-6195-435b-90a6-e511856f128e@gmail.com> (Phillip Wood's message of "Wed, 29 Jul 2026 10:39:11 +0100")
Phillip Wood <phillip.wood123@gmail.com> writes:
> Thanks for adding some tests for this option
>
>> diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
>> index 44c726ea39..d28d9dab2c 100755
>> --- a/t/t6010-merge-base.sh
>> +++ b/t/t6010-merge-base.sh
>> @@ -305,4 +305,38 @@ test_expect_success 'merge-base --octopus --all for complex tree' '
>> test_cmp expected actual
>> '
>>
>> +test_expect_success 'setup --is-ancestor' '
>> + git init is-ancestor &&
>> + (
>> + cd is-ancestor &&
>> + test_commit one &&
>> + test_commit two &&
>> + git checkout -b side one &&
>> + test_commit three
>> + )
>> +'
>
> Do we really need to create a new repository? None of the existing tests
> do that - can't we just use the commits created by the first test?
Good point. It is often a lot more work to do so when writing these
new tests, and I suspect that is the reason why this new repository
was created, but I do not know whether, in the long run, it is
cheaper and more maintainable to reuse the test history that has been
used by all existing tests above. The next developer who needs to
tweak the first test has 5 (the number of tests below) extra
constraints if we go that route, but a separate setup means the two
sets of tests are more isolated.
> Having said that, the tests below look good. We could perhaps have a
> test to check that it fails with one commit or three commits but what
> you have here is clearly a very useful improvement in our test coverage.
Thanks.
prev parent reply other threads:[~2026-07-29 15:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 17:00 [PATCH] merge-base: add tests for --is-ancestor Nikolaus Schuetz via GitGitGadget
2026-07-28 22:48 ` Junio C Hamano
2026-07-29 9:39 ` Phillip Wood
2026-07-29 15:31 ` Junio C Hamano [this message]
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=xmqqo6fpak2k.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=nikolauspschuetz@gmail.com \
--cc=phillip.wood123@gmail.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.