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

2012-10-29 Thread W. Trevor King
On Mon, Oct 29, 2012 at 01:34:01AM -0400, Jeff King wrote: On Sun, Oct 28, 2012 at 06:34:31PM -0400, W. Trevor King wrote: On Sun, Oct 28, 2012 at 02:59:33PM -0700, Shawn Pearce wrote: Looks like the Gerrit meaning is basically the same as Ævar's. Gerrit updates the parent project as if

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

2012-10-29 Thread Jeff King
On Mon, Oct 29, 2012 at 06:45:44AM -0400, W. Trevor King wrote: Ah, good, then we *are* all using the option for the same thing. That makes me more comfortable. Your patch adds support for setting the variable initially. Does it need any special magic for maintenance, or is it

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

2012-10-29 Thread Jeff King
On Mon, Oct 29, 2012 at 07:29:45AM -0400, W. Trevor King wrote: On Mon, Oct 29, 2012 at 06:58:55AM -0400, Jeff King wrote: Can you send an updated version of the patch that summarizes the situation in the commit message? Sure. Should I include Phil's $submodule_var-name export, or would

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

2012-10-29 Thread Jeff King
On Mon, Oct 29, 2012 at 01:38:28PM -0400, Phil Hord wrote: I am not sure it is sufficient as-is, though. It does not seem to ever clear variables, only set them, which means that values could leak across iterations of the loop, [...] E.g., when the first submodule has submodule.*.foo set

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

2012-10-29 Thread Phil Hord
On Mon, Oct 29, 2012 at 5:36 PM, Jeff King p...@peff.net wrote: On Mon, Oct 29, 2012 at 01:38:28PM -0400, Phil Hord wrote: I am not sure it is sufficient as-is, though. It does not seem to ever clear variables, only set them, which means that values could leak across iterations of the

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

2012-10-29 Thread Jeff King
On Mon, Oct 29, 2012 at 06:21:08PM -0400, Phil Hord wrote: Maybe instead of blindly converting config into the environment, it should forward or clear specific known-meaning config. Well, that's where we started. I was aiming for the more generic never needs updating direction. Then I

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

2012-10-28 Thread Jens Lehmann
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:

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

2012-10-28 Thread W. Trevor King
On Sun, Oct 28, 2012 at 09:48:18PM +0100, Jens Lehmann wrote: 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

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

2012-10-28 Thread Shawn Pearce
On Sun, Oct 28, 2012 at 1:48 PM, Jens Lehmann jens.lehm...@web.de wrote: 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

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

2012-10-28 Thread W. Trevor King
On Sun, Oct 28, 2012 at 02:59:33PM -0700, Shawn Pearce wrote: Looks like the Gerrit meaning is basically the same as Ævar's. Gerrit updates the parent project as if you had done: $ git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) git

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

2012-10-28 Thread Jeff King
On Sun, Oct 28, 2012 at 06:34:31PM -0400, W. Trevor King wrote: On Sun, Oct 28, 2012 at 02:59:33PM -0700, Shawn Pearce wrote: Looks like the Gerrit meaning is basically the same as Ævar's. Gerrit updates the parent project as if you had done: $ git submodule foreach 'git checkout

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

2012-10-26 Thread Jeff King
On Thu, Oct 25, 2012 at 06:14:31PM -0400, W. Trevor King wrote: Should I rebase this so it lands cleanly atop 38ae92e4 in next? commit 38ae92e4d027063b9b87e51a9bf12809d10066f6 Author: W. Trevor King wk...@tremily.us Date: Tue Oct 23 17:00:21 2012 -0400 git-submodule: wrap

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

2012-10-24 Thread Jens Lehmann
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

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

2012-10-24 Thread 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

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

2012-10-23 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us This option allows you to record a submodule.name.branch option in .gitmodules. Git does not currently use this configuration option for anything, but users have used it for several things, so it makes sense to add some syntactic sugar for initializing the