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

Re: [PATCH v2] git-submodule add: Add -r/--record option.

From
W. Trevor King <wking@tremily.us>
Date
Oct 28, 2012, 21:16 UTC
Message-ID
<20121028211623.GE26675@odin.tremily.us>
In-Reply-To
<508D9A12.6010104@web.de>
On Sun, Oct 28, 2012 at 09:48:18PM +0100, Jens Lehmann wrote:
Show 17 quoted lines
> Am 25.10.2012 02:53, schrieb W. Trevor King:
> > On Wed, Oct 24, 2012 at 09:15:32PM +0200, Jens Lehmann wrote:
> >> I still fail to see what adding that functionality to the submodule
> >> command buys us (unless we also add code which really uses the branch
> >> setting). What's wrong with doing a simple:
> >>
> >>    git config -f .gitmodules submodule.<path>.branch <record_branch>
> >>
> >> on the command line when you want to use the branch setting for your
> >> own purposes? You could easily wrap that into a helper script, no?
> > 
> > Sure.  But why maintain my own helper script if I can edit
> > git-submodules.sh?  It seems like a number of people are using this
> > config option, and they generally store the same name in it that they
> > use to create the submodule.  This way I can save them time too.
> 
> But people are already using the "branch" setting in *different* ways:

And they are usually storing the same string. Now, more easily. If they want a different string, it is also easier. If they don't want to use --record, they can do things however they were already doing them. I don't see the problem.

Show 14 quoted lines
> Am 23.10.2012 22:55, schrieb W. Trevor King:
> > As Phil pointed out, doing anything with this variable is ambiguous:
> >
> > On Mon, Oct 22, 2012 at 06:03:53PM -0400, Phil Hord wrote:
> >> Some projects now use the 'branch' config value to record the tracking
> >> branch for the submodule.  Some ascribe different meaning to the
> >> configuration if the value is given vs. undefined.  For example, see
> >> the Gerrit submodule-subscription mechanism.  This change will cause
> >> those workflows to behave differently than they do now.
> 
> I don't have a problem with the amount or complexity of the code being
> added, But by adding that option we may be giving the impression that it
> is officially sanctioned, or that it will be kept up to date by further
> submodule commands.

Storing something there will be officially sanctioned. Using it for anything in particular will not be officially sanctioned. Phil's submodule_<var-name> export in foreach will expose the variable so the user can do whatever they think is appropriate with it, but it's still up to the user to give the option some kind of semantic meaning.

> I added Shawn to the CC, maybe he can comment on how the "branch"
> setting is used in Gerrit and what he thinks about adding code to
> set that with "git submodule add -r <branch> ..." to core git.
Good idea.
Trevor
-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
Previous: Jens LehmannNext: Shawn Pearce
Message 6 of 19 in “Re: [PATCH] git-submodule add: Record branch name in .gitmodules”
  1. W. Trevor KingOct 23, 2012
  2. git-submodule add: Add -r/--record option.W. Trevor King, Oct 23, 2012
  3. Jens LehmannOct 24, 2012
  4. W. Trevor KingOct 25, 2012
  5. Jens LehmannOct 28, 2012
  6. W. Trevor KingOct 28, 2012
  7. Shawn PearceOct 28, 2012
  8. W. Trevor KingOct 28, 2012
  9. Jeff KingOct 29, 2012
  10. W. Trevor KingOct 29, 2012
  11. Jeff KingOct 29, 2012
  12. W. Trevor KingOct 29, 2012
  13. Jeff KingOct 29, 2012
  14. Phil HordOct 29, 2012
  15. Jeff KingOct 29, 2012
  16. Phil HordOct 29, 2012
  17. Jeff KingOct 29, 2012
  18. W. Trevor KingOct 25, 2012
  19. Jeff KingOct 26, 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.