From: Jacob Keller <jacob.e.keller@intel.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: issue with git submodules and a clone.defaultRemoteName different than origin?
Date: Fri, 6 Jun 2025 14:29:48 -0700 [thread overview]
Message-ID: <bdf7e50f-aa65-4514-b147-9f7ebed147ab@intel.com> (raw)
In-Reply-To: <48c2af0f-348a-4443-a8b7-74ea4b666bff@intel.com>
On 6/4/2025 10:18 AM, Jacob Keller wrote:
>
> the parent project already has a URL in its config. What if we updated
> the logic to just directly use that URL instead of using a remote name?
> Or at the very least, we try to pick a remote based on the URL.
>
I'm looking into this approach still, but I ran into some interesting
issues with the remote.c logic which claims to work with any "struct
repository *", but ends up calling paths to that hard code the_repository.
It looks like those end up in the "read_remotes_file" and
"read_branches_file" functions which are deprecated, and planned to be
removed in 3.0...
Would patches to modify those to take a repository pointer in order to
allow callers of read_config() to work properly with a submodule
repository be acceptable?
I also saw that many functions take a remote_state structure, but if I
wanted to make them submodule repo compatible I would need to either add
or switch to passing a repo pointer. I'm not sure what the best method
for that is. Add parameters? We can get from repo to remote_state easily
but we can't go back, so it seems like just switching them to take repo
instead of remote_state would be sufficient.
I wanted to use the remote.c helpers rather than re-inventing the logic
for reading the config to figure out remotes, both a) to find the
correct remote by its URL and b) to find out if there is exactly 1 remote.
next prev parent reply other threads:[~2025-06-06 21:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 23:06 issue with git submodules and a clone.defaultRemoteName different than origin? Jacob Keller
2025-06-03 23:42 ` Junio C Hamano
2025-06-04 17:18 ` Jacob Keller
2025-06-06 21:29 ` Jacob Keller [this message]
2025-06-06 23:32 ` Junio C Hamano
2025-06-07 5:43 ` Patrick Steinhardt
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=bdf7e50f-aa65-4514-b147-9f7ebed147ab@intel.com \
--to=jacob.e.keller@intel.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 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.