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

[RFC/PATCH 0/4] submodule remotes

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 8, 2015, 10:58 UTC
Message-ID
<1428490705-11586-1-git-send-email-ps@pks.im>

The following patch series implements a new feature on top of the submodule command that allows for configuring multiple remotes for a given submodule. Next to new subcommands `git submodule remote (add|rm|set-url|show)` that allow to show and modify remotes for a given submodule, `git remote sync` has been extended to apply settings to the repositories.

The commands are implemented in such a way that they write the remote configuration into .gitmodules according to the following example:

    [submodule-remote "submodule-name.remote-name"]
    url = http://example.com/remote.git
    pushurl = git@example.com:remote.git

where "submodule-name" is the submodule's name and "remote-name" is the name of the remote when it will be synchronized into the submodule repository. The section-name is definitly up for discussion and I don't really know if there might be issues with the format "submodule-name.remote-name", but as far as I know there is no possibility of having sub-subsections inside config files.

There are some issues that I am currently aware of:
    - If we specify a remote "origin" for a submodule, `git
      submodule sync` will happily overwrite
      submodule.${submodule-name}.url. We certainly don't want to
      drop the old way of specifying a single URL but I am not
      sure what to do when a new "origin" has been specified.
      Perhaps a warning or user confirmation would suffice?
    - If the user specifies his own remotes and afterwards syncs
      the submodule's remotes, his settings will be overwritten.
      Maybe remotes should only be synced when a switch is
      specified (e.g. `git submodule sync --remotes` or `git
      submodule remotes sync`)?

This patch series is not intended to be included as-is as there are no tests yet and the implementation has not been tested that much. It should only evaluate if there is any interest and hopefully spark some discussion as to if this feature is something that is regarded as useful to others.

iveqy in IRC told me that there has been a discussion on something similar, I wasn't able to find that though.

Regards Patrick

Patrick Steinhardt (4):
  submodules: implement synchronizing of remotes.
  submodules: implement remote commands.
  submodules: update docs to reflect remotes.
  submodules: add bash completion for remotes.
 Documentation/git-submodule.txt        |  23 +++
 contrib/completion/git-completion.bash |   2 +-
 git-submodule.sh                       | 252 ++++++++++++++++++++++++++++++++-
 3 files changed, 274 insertions(+), 3 deletions(-)
-- 
2.3.5
Next: Patrick Steinhardt
Message 1 of 7 in “submodule remotes”
  1. 0/4 submodule remotesPatrick Steinhardt, Apr 8, 2015
  2. 1/4 submodules: implement synchronizing of remotes.Patrick Steinhardt, Apr 8, 2015
  3. Junio C HamanoApr 8, 2015
  4. Patrick SteinhardtApr 9, 2015
  5. 2/4 submodules: implement remote commands.Patrick Steinhardt, Apr 8, 2015
  6. 3/4 submodules: update docs to reflect remotes.Patrick Steinhardt, Apr 8, 2015
  7. 4/4 submodules: add bash completion for remotes.Patrick Steinhardt, Apr 8, 2015

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.