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

[PATCH v5 0/2] submodule update: add --remote for submodule's upstream changes

From
W. Trevor King <wking@tremily.us>
Date
Nov 28, 2012, 19:30 UTC
Message-ID
<cover.1354130656.git.wking@tremily.us>
In-Reply-To
<20121128165334.GA20483@odin.tremily.us>
From: "W. Trevor King" <wking@tremily.us>
On Wed, Nov 28, 2012 at 11:53:34AM -0500, W. Trevor King wrote:
Show 6 quoted lines
> I thought of a better idea on the train.  How about adding `--remote`
> to `submodule update` that overrides the gitlinked SHA-1 with the
> SHA-1 for origin/$branch?  All of the other checkout/merge/rebase
> functionality is untouched.  The only thing that changes is where we
> look for the update.  I'm working up the patch now, and will submit v5
> shortly.
Here it is.
Changes since v4:
* Remove `update --branch` in favor of the new `update --remote` logic
  as mentioned above.
* Optional config overrides for submodule.<name>.branch (as suggested
  by Jens)
* Save --branch as submodule.<name>.branch instead of requiring
  --local-branch.
* Restructure doc edits.

I'm a lot happier with this two-patch proposal. The first patch implements --remote and documents submodule.<name>.branch. The second patch just gives you a convenient way to set it. I haven't heard from anyone other than Heiko recently about the --branch/--remote-branch choice, so I returned to the simpler --branch side effect storage from v1. I'd be happy to submit v6 with explicit --remote-branch recording if desired.

W. Trevor King (2):
  submodule update: add --remote for submodule's upstream changes
  submodule add: If --branch is given, record it in .gitmodules
 Documentation/config.txt        |  9 +++++----
 Documentation/git-submodule.txt | 26 +++++++++++++++++++++++++-
 Documentation/gitmodules.txt    |  5 +++++
 git-submodule.sh                | 30 +++++++++++++++++++++++++++++-
 t/t7400-submodule-basic.sh      |  1 +
 t/t7406-submodule-update.sh     | 31 +++++++++++++++++++++++++++++++
 6 files changed, 96 insertions(+), 6 deletions(-)
-- 
1.8.0.2.gad10246.dirty
Previous: W. Trevor KingNext: W. Trevor King
Message 3 of 5 in “Re: [PATCH v4 0/4] git-submodule add: Add --local-branch option (summary)”
  1. W. Trevor KingNov 28, 2012
  2. W. Trevor KingNov 28, 2012
  3. 0/2 submodule update: add --remote for submodule's upstream changesW. Trevor King, Nov 28, 2012
  4. 1/2 submodule update: add --remote for submodule's upstream changesW. Trevor King, Nov 28, 2012
  5. 2/2 submodule add: If --branch is given, record it in .gitmodulesW. Trevor King, Nov 28, 2012

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.