All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nasser Grainawi <nasser.grainawi@oss.qualcomm.com>
Cc: git@vger.kernel.org,  "D. Ben Knoble" <ben.knoble@gmail.com>,
	 Patrick Steinhardt <ps@pks.im>,
	 Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH v3] submodule: fetch missing objects from default remote
Date: Fri, 23 Jan 2026 18:18:25 -0800	[thread overview]
Message-ID: <xmqqms23lpn2.fsf@gitster.g> (raw)
In-Reply-To: <xmqq4iobhpvg.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 23 Jan 2026 15:26:59 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Nasser Grainawi <nasser.grainawi@oss.qualcomm.com> writes:
>
>> diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
>> index 45f384dd32..faafe31409 100755
>> --- a/t/t5572-pull-submodule.sh
>> +++ b/t/t5572-pull-submodule.sh
>> @@ -257,7 +257,26 @@ test_expect_success 'fetch submodule remote of different name from superproject'
>>  	git -C a-submodule reset --hard HEAD^^ &&
>>  
>>  	git -C child pull --no-recurse-submodules &&
>> -	git -C child submodule update
>> +	git -C child submodule update &&
>> +	test_path_is_file child/a-submodule/moreecho.t
>> +'
>> +
>> +test_expect_success 'fetch submodule remote of different non-origin name from superproject' '
>> +	git -C child/a-submodule remote rename origin o2 &&
>> +
>> +	# Create commit that is unreachable from current master branch
>> +	git -C a-submodule checkout -b newmain2 master^ &&
>
> This test assumes that the first branch created by default is
> 'master', which will break in one of the CI jobs:
>
>   https://github.com/git/git/actions/runs/21304166518/job/61328461844#step:9:1942

For now, I've queued two fix-up patches on top of the posted patch
to avoid CI breakages when the topic is merged to 'seen'.  One is to
rename t7425-submodule-get-default-remote.sh to t7426-submodule-get-default-remote.sh
(both filename and the reference to it in t/meson.build), and the
other one is the following.

----- >8 -----
Subject: [PATCH] SQUASH??? fixup

The test as posted breaks when run with

    $ make WITH_BREAKING_CHANGES=YesPlease test

as the added part assumes that the default branch name is "master".

This band-aid is sufficient for the purpose of the maintainer to get
the CI passing, but the real solution should probably be done better
in such a way that the latter step does not have to rely on the
creation of "anchorpoint" in the previous step.  I'll leave it to
the contributor of the topic.
---
 t/t5572-pull-submodule.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index faafe31409..dfc07d050b 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -246,7 +246,8 @@ test_expect_success 'fetch submodule remote of different name from superproject'
 	git -C child submodule update --init &&
 
 	# Needs to create unreachable commit from current master branch.
-	git -C a-submodule checkout -b newmain HEAD^ &&
+	git -C a-submodule tag anchorpoint HEAD &&
+	git -C a-submodule checkout -b newmain anchorpoint^ &&
 	test_commit -C a-submodule echo &&
 	test_commit -C a-submodule moreecho &&
 	subc=$(git -C a-submodule rev-parse --short HEAD) &&
@@ -265,7 +266,7 @@ test_expect_success 'fetch submodule remote of different non-origin name from su
 	git -C child/a-submodule remote rename origin o2 &&
 
 	# Create commit that is unreachable from current master branch
-	git -C a-submodule checkout -b newmain2 master^ &&
+	git -C a-submodule checkout -b newmain2 anchorpoint^ &&
 	test_commit -C a-submodule echo_o2 &&
 	test_commit -C a-submodule moreecho_o2 &&
 	subc=$(git -C a-submodule rev-parse --short HEAD) &&
-- 
2.53.0-rc1-193-g609e9a7b29


  reply	other threads:[~2026-01-24  2:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 21:36 [PATCH] Fetch missing submodule objects from default remote Nasser Grainawi
2026-01-13  2:17 ` Jacob Keller
2026-01-13 21:51 ` Ben Knoble
2026-01-13 22:41   ` Nasser Grainawi
2026-01-14  2:19     ` D. Ben Knoble
2026-01-14 14:10       ` Junio C Hamano
2026-01-14 21:22         ` Ben Knoble
2026-01-14 14:05   ` Junio C Hamano
2026-01-14 19:23     ` Nasser Grainawi
2026-01-14 19:48 ` [PATCH v2] submodule: fetch missing " Nasser Grainawi
2026-01-21  0:48   ` Nasser Grainawi
2026-01-22 15:27   ` [PATCH v3] " Nasser Grainawi
2026-01-22 18:49     ` Junio C Hamano
2026-01-22 20:16       ` Jacob Keller
2026-01-22 20:38         ` Junio C Hamano
2026-02-25 21:55         ` Junio C Hamano
2026-03-02 22:06           ` Jacob Keller
2026-02-27 18:29       ` Nasser Grainawi
2026-01-22 21:21     ` Junio C Hamano
2026-01-23 23:26     ` Junio C Hamano
2026-01-24  2:18       ` Junio C Hamano [this message]
2026-02-20 23:12         ` Junio C Hamano
2026-02-27 17:20           ` Nasser Grainawi
2026-03-01  2:53     ` [PATCH v4] " Nasser Grainawi
2026-03-02 22:09       ` Jacob Keller
2026-03-02 22:11         ` Junio C Hamano
2026-03-03  2:11       ` Junio C Hamano
2026-03-03 19:00         ` Nasser Grainawi
2026-03-03 19:26           ` Nasser Grainawi
2026-03-03 20:02             ` Junio C Hamano
2026-03-03 20:09       ` [PATCH v5] " Nasser Grainawi
2026-03-03 20:47         ` Ramsay Jones
2026-03-03 21:26           ` Junio C Hamano
2026-03-03 23:29             ` Nasser Grainawi
2026-03-03 23:40         ` [PATCH v6] " Nasser Grainawi
2026-03-09 23:40           ` Junio C Hamano

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=xmqqms23lpn2.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=nasser.grainawi@oss.qualcomm.com \
    --cc=ps@pks.im \
    /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.