Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-24 Thread Phil Hord
On Mon, Oct 22, 2012 at 6:55 PM, W. Trevor King wk...@tremily.us wrote: On a tangentially related note, it would be nice to set environment variables for each of the settings in submodule.$name during a foreach call. Then you could use git submodule foreach 'git checkout $branch git pull'

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-24 Thread Jens Lehmann
Am 24.10.2012 00:02, schrieb Nahor: On 2012-10-23 13:36, Jens Lehmann wrote: Am 23.10.2012 21:16, schrieb Nahor: Last issue, the branch that exists in your local repository may not exist in someone else's repository, either because the branch is purely local, or because it has a different

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-24 Thread W. Trevor King
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

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-24 Thread W. Trevor King
On Wed, Oct 24, 2012 at 02:12:18PM -0400, Phil Hord wrote: + VAR_NAME=$(printf '%s' $VAR_NAME | tr A-Z a-z | sed -e 's/^[^a-z]/_/' -e 's/[^a-z0-9]/_/g') Is there a reason why you use printf instead of echo? Also, this sort of name cleaning should probably

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread Nahor
On 2012-10-22 09:34, W. Trevor King wrote: From: W. Trevor King wk...@tremily.us This removes a configuration step if you're trying to setup Ævar's $ git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) git pull' workflow from commit

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread Jens Lehmann
Am 23.10.2012 21:16, schrieb Nahor: On 2012-10-22 09:34, W. Trevor King wrote: From: W. Trevor King wk...@tremily.us This removes a configuration step if you're trying to setup Ævar's $ git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch)

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread W. Trevor King
On Tue, Oct 23, 2012 at 12:16:22PM -0700, Nahor wrote: On 2012-10-22 09:34, W. Trevor King wrote: For instance, the module may later be updated to a commit in branch B instead of branch A. Unless you remember to also update .gitmodule, you have then inconsistent information. But you're

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread W. Trevor King
On Tue, Oct 23, 2012 at 03:44:36PM -0400, W. Trevor King wrote: On Tue, Oct 23, 2012 at 12:16:22PM -0700, Nahor wrote: On 2012-10-22 09:34, W. Trevor King wrote: For instance, the module may later be updated to a commit in branch B instead of branch A. Unless you remember to also update

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread Nahor
On 2012-10-23 12:44, W. Trevor King wrote: On Tue, Oct 23, 2012 at 12:16:22PM -0700, Nahor wrote: On 2012-10-22 09:34, W. Trevor King wrote: For instance, the module may later be updated to a commit in branch B instead of branch A. Unless you remember to also update .gitmodule, you have then

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread W. Trevor King
On Tue, Oct 23, 2012 at 10:36:44PM +0200, Jens Lehmann wrote: Except recording the branch name might raise expectations about what git will do with it. And as far as this patch goes, git won't do anything with it (yet). As Phil pointed out, doing anything with this variable is ambiguous: On

Re: [PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-23 Thread Nahor
On 2012-10-23 13:36, Jens Lehmann wrote: Am 23.10.2012 21:16, schrieb Nahor: Last issue, the branch that exists in your local repository may not exist in someone else's repository, either because the branch is purely local, or because it has a different name on the remote repo. You'll

[PATCH] git-submodule add: Record branch name in .gitmodules

2012-10-22 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us This removes a configuration step if you're trying to setup Ævar's $ git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) git pull' workflow from commit f030c96d8643fa0a1a9b2bd9c2f36a77721fb61f