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

Re: [PATCH 3/3] git-submodule: add "sync" command

From
David Aguilar <davvid@gmail.com>
Date
Aug 24, 2008, 19:23 UTC
Message-ID
<20080824192343.GA22134@gmail.com>
In-Reply-To
<7vwsi6meas.fsf@gitster.siamese.dyndns.org>
On  0, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> David Aguilar <davvid@gmail.com> writes:
> > +		(
> > +			unset GIT_DIR
> > +			cd "$path"
> > +			remote=$(get_remote)
> > +			say "Synchronizing submodule url for '$name'"
> > +			git config remote."$remote".url "$url"
> 
> I am not sure about the way you determine $remote.  When the HEAD in the
> submodule repository is detached by prior "git submodule update", this
> will fall back to the default "origin" --- is it a good behaviour?
> 
> This is not an objection; I am merely wondering if that fallback is
> sensible, or if people who are interested in submodules can suggest better
> alternatives.

This is true. I recall there was a lengthy thread a while back about how "origin" might not always be what you'd want when cloning a repo. I'll address your comments, use Mark's get_default_remote, and resend. I have a feeling that addressing the use of remote names in submodules is beyond the scope of this patch for now since it seems like we'd need that info stored somewhere in a superproject gitfile.

-- 
	David
Previous: Junio C HamanoNext: David Aguilar
Message 6 of 14 in “git-submodule: add "sync" command (v2)”
  1. David AguilarAug 24, 2008
  2. 1/3 git-submodule: add a get_remote functionDavid Aguilar, Aug 24, 2008
  3. 2/3 git-submodule: use get_remote in resolve_relative_urlDavid Aguilar, Aug 24, 2008
  4. 3/3 git-submodule: add "sync" commandDavid Aguilar, Aug 24, 2008
  5. Junio C HamanoAug 24, 2008
  6. David AguilarAug 24, 2008
  7. git-submodule: add "sync" commandDavid Aguilar, Aug 24, 2008
  8. David AguilarAug 27, 2008
  9. Junio C HamanoAug 27, 2008
  10. Mark LevedahlAug 24, 2008
  11. Junio C HamanoAug 24, 2008
  12. Junio C HamanoAug 24, 2008
  13. git-submodule - Use "get_default_remote" from git-parse-remoteMark Levedahl, Aug 24, 2008
  14. Junio C HamanoAug 24, 2008

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.