git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Relative submodule URLs

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Aug 19, 2014, 16:15 UTC
Message-ID
<CAHd499CJfX_n_KnQScTFueCSkj6i0x0ozwwD8Oe_2a-VH2oq1w@mail.gmail.com>
In-Reply-To
<20140819102421.GA5012@book.hvoigt.net>
On Tue, Aug 19, 2014 at 5:24 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
Show 6 quoted lines
> I think the OP problem stems from him having a branch that does not have a
> remote configured. Since they do not have 'origin' as a remote and
>
>         git submodule update --init --recursive path/to/submodule
>
> fails. Right?

Not exactly. The issue is that there is a tug of war going on between three specific commands (all of which utilize the tracked remote):

git fetch git pull git submodule update (for relative submodules)

The way I set up my remote tracking branch will be different for each of these commands:

- git pull :: If I want convenient pulls (with rebase), I will track
my upstream branch. My pushes have to be more explicit as a tradeoff.
- git push :: If I want convenient pushes, track my origin branch.
Pulls become less convenient. My relative submodules will now need to
be forked.
- git submodule update :: I track upstream to avoid forking my
submodules. But pushes become more inconvenient.

As you can see, I feel like we're overusing the single remote setting. Sure, we've added some global settings to set default push/pull remotes and such, but I don't think that is a sustainable long term solution. I like the idea of possibly introducing multiple tracking remotes for various purposes. This adds some additional configuration overhead (slightly), but git is already very config heavy so it might be worth exploring. At least, this feels like a better thing for the long term as I won't be constantly switching my tracking remote for various purposes.

Could also explore the possibility of creating "const remotes". If we specify a remote MUST exist for relative submodules, git can create it for us, and fail to operate without it. It's up to the user to map "fork" to "origin" if needed (perhaps add a `git remote clone <source> <new remote>` to assist with this)?

Various approaches we can take, but I don't do development on Git so I'm not sure what makes the most sense.

Previous: Heiko VoigtNext: Junio C Hamano
Message 4 of 25 in “Relative submodule URLs”
  1. Robert DaileyAug 18, 2014
  2. Jonathan NiederAug 18, 2014
  3. Heiko VoigtAug 19, 2014
  4. Robert DaileyAug 19, 2014
  5. Junio C HamanoAug 19, 2014
  6. Robert DaileyAug 19, 2014
  7. Junio C HamanoAug 19, 2014
  8. Robert DaileyAug 19, 2014
  9. Heiko VoigtAug 19, 2014
  10. Robert DaileyAug 19, 2014
  11. Heiko VoigtAug 19, 2014
  12. Robert DaileyAug 20, 2014
  13. Heiko VoigtAug 21, 2014
  14. Robert DaileyAug 19, 2014
  15. Marc BranchaudAug 22, 2014
  16. Heiko VoigtAug 24, 2014
  17. Robert DaileyAug 25, 2014
  18. Robert DaileyAug 25, 2014
  19. Heiko VoigtAug 26, 2014
  20. Robert DaileyAug 26, 2014
  21. Heiko VoigtAug 26, 2014
  22. Robert DaileyAug 25, 2014
  23. Marc BranchaudAug 28, 2014
  24. Heiko VoigtAug 28, 2014
  25. Marc BranchaudAug 29, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.