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

Re: [BUG?] git submodule update --remote assumes 'origin' remote

From
Sean Barag <sean@barag.org>
Date
Mar 1, 2021, 17:17 UTC
Message-ID
<58d3b7ba-b65d-432f-872d-adea7fad1317@www.fastmail.com>
In-Reply-To
<2d58fe40-9e8c-4653-8170-5411fd3cf6f4@www.fastmail.com>
On Mon, Mar 01 2021, Sean Barag wrote:
Show 12 quoted lines
> I've experimented with
> introducing fallbacks to `remote_for_branch` in `remote.c` [2] as an
> alternative:
> 
> 1. use remote tracking branch; or
> 2. if there's only one remote, use that; or
> 3. if config.defaultRemoteName is set, use that; or
> 4. fall back to "origin"
> 
> This seems to work (at the very least, no tests fail?), but leaves
> `cd ./some-sm; git remote add foo bar; git remote rename origin baz`
> open to the original behavior.

I forgot to mention that this approach requires `get_default_remote` in `submodule--helper.c` to use the name of the remote returned by `remote_get(NULL)`. That was probably obvious to regular mailing list readers :D

Previous: Sean Barag
Message 4 of 4 in “[BUG?] git submodule update --remote assumes 'origin' remote”
  1. Sean BaragMar 1, 2021
  2. Ævar Arnfjörð BjarmasonMar 1, 2021
  3. Sean BaragMar 1, 2021
  4. Sean BaragMar 1, 2021

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.