[PATCH] submodule: Respect reqested branch on all clones

2014-01-03 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us The previous code only checked out the requested branch in cmd_add. This commit moves the branch-checkout logic into module_clone, where it can be shared by cmd_add and cmd_update. I also update the initial checkout command to use 'rebase' to preserve

[PATCH] Documentation/gitmodules: Only 'update' and 'url' are required

2014-01-03 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us Before this commit, all the settings fell under the initial Each submodule section also contains the following required keys:. The example shows sections with just 'update' and 'url' entries, but we should still make the required/optional distinction

Re: [PATCH] submodule: Respect reqested branch on all clones

2014-01-04 Thread W. Trevor King
On Sat, Jan 04, 2014 at 11:09:15PM +0100, Heiko Voigt wrote: On Fri, Jan 03, 2014 at 10:06:11AM -0800, W. Trevor King wrote: @@ -306,7 +307,14 @@ module_clone() echo gitdir: $rel/$a $sm_path/.git rel=$(echo $a | sed -e 's|[^/][^/]*|..|g') - (clear_local_git_env; cd $sm_path

Re: [PATCH] Documentation/gitmodules: Only 'update' and 'url' are required

2014-01-04 Thread W. Trevor King
On Sat, Jan 04, 2014 at 11:17:54PM +0100, Heiko Voigt wrote: On Fri, Jan 03, 2014 at 10:31:22AM -0800, W. Trevor King wrote: Before this commit, all the settings fell under the initial Each submodule section also contains the following required keys:. The example shows sections with just

Re: [PATCH] submodule: Respect reqested branch on all clones

2014-01-04 Thread W. Trevor King
On Sun, Jan 05, 2014 at 01:39:22AM +0100, Heiko Voigt wrote: On Sat, Jan 04, 2014 at 02:54:01PM -0800, W. Trevor King wrote: On Sat, Jan 04, 2014 at 11:09:15PM +0100, Heiko Voigt wrote: On Fri, Jan 03, 2014 at 10:06:11AM -0800, W. Trevor King wrote: @@ -861,7 +860,12 @@ Maybe you want

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-05 Thread W. Trevor King
On Sun, Jan 05, 2014 at 08:48:50PM +0100, Heiko Voigt wrote: On Sun, Jan 05, 2014 at 08:17:00AM -0800, W. Trevor King wrote: It's not clear if this refers to the initial-clone update, future post-clone updates, or both. Ideally, the behavior should be the same, but in the initial-clone

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-05 Thread W. Trevor King
On Sun, Jan 05, 2014 at 10:27:19PM +0100, Francesco Pretto wrote: 2014/1/5 W. Trevor King: Adding a check to only checkout submodule.name.branch if submodule.name.update was 'rebase', 'merge', or 'none' would be easy, but I don't think that makes much sense. I can't see any reason

Re: Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-05 Thread W. Trevor King
On Sun, Jan 05, 2014 at 11:57:33PM +0100, Heiko Voigt wrote: On Sun, Jan 05, 2014 at 01:24:58PM -0800, W. Trevor King wrote: If submodule.name.branch is set, it *always* creates a new local branch of that name pointing to the exact sha1. If submodule.name.branch is not set, we still create

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-05 Thread W. Trevor King
On Sun, Jan 05, 2014 at 03:39:43PM -0800, W. Trevor King wrote: On Sun, Jan 05, 2014 at 11:57:33PM +0100, Heiko Voigt wrote: The reason why one would set a branch option here is to share the superproject branch with colleagues. He can make sure they can always fetch and checkout

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-05 Thread W. Trevor King
On Sun, Jan 05, 2014 at 04:33:14PM -0800, W. Trevor King wrote: The only people who would need *automatic* rebase recovery would be superproject devs update-cloning the subproject. That's a small enough cross-section that I don't think it deserves the ambiguity of gitlink-to-reference

Re: [PATCH 2/2] Introduce git submodule attached update

2014-01-06 Thread W. Trevor King
On Mon, Jan 06, 2014 at 03:18:05PM +0100, Heiko Voigt wrote: If you simply want to always checkout the development tip of some project you could do something like this: git submodule foreach 'git fetch git checkout origin/master' Or (respecting submodule.name.branch): $ git

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-06 Thread W. Trevor King
On Mon, Jan 06, 2014 at 04:47:39PM +0100, Heiko Voigt wrote: On Sun, Jan 05, 2014 at 03:39:43PM -0800, W. Trevor King wrote: On Sun, Jan 05, 2014 at 11:57:33PM +0100, Heiko Voigt wrote: On Sun, Jan 05, 2014 at 01:24:58PM -0800, W. Trevor King wrote: Thinking through this more, perhaps

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-06 Thread W. Trevor King
On Mon, Jan 06, 2014 at 08:56:22AM -0800, Junio C Hamano wrote: Heiko Voigt hvo...@hvoigt.net writes: Yes, why would you do a git pull in a submodule? Don't you want to do something like git checkout -t -b dev/my-topic origin/master to start your development? As long as

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-07 Thread W. Trevor King
to the explicit submodule $sha1. Otherwise the default method for that operation is a HEAD-detaching 'checkout'. I tried to explain it here [3]. W. Trevor King wk...@tremily.us writes: The current Documentation/git-submodule.txt has: update:: Update the registered submodules, i.e. clone

Re: [PATCH 2/2] Introduce git submodule attached update

2014-01-07 Thread W. Trevor King
On Mon, Jan 06, 2014 at 08:21:24PM +0100, David Engster wrote: +---+ | master | -- +---++---+| Merges to/from master | CEDET | | done only by CEDET developers +---+ |

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 08:19:49PM +0100, Francesco Pretto wrote: 2014/1/7 Junio C Hamano gits...@pobox.com: It is not immediately obvious to me why anybody who specifies the submodule.*.branch variable to say I want _that_ branch not to want to be on that branch but in a detached state, so

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 11:21:28AM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: On Tue, Jan 07, 2014 at 10:15:25AM -0800, Junio C Hamano wrote: Having writing all the above and then looking at the patch again, it is not immediately obvious to me where you use rebase

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 09:09:19PM +0100, Francesco Pretto wrote: 2014/1/7 W. Trevor King wk...@tremily.us: Trevor, maybe it was not clear. But I wanted to say: I fully support *Trevor's* patch... :) Which I appreciate ;). I still though I should point out that my patch *confuses

Preferred local submodule branches (was: Introduce git submodule attached update)

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 10:51:34PM +0100, Francesco Pretto wrote: 2014/1/7 W. Trevor King wk...@tremily.us: I'd be happy to hear ideas about superproject-branch-specific local overrides to a hypothetical submodule.name.local-branch, in the event that a developer doesn't like a default set

Re: [PATCH 2/2] Introduce git submodule attached update

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 11:51:28PM +0100, Heiko Voigt wrote: On Mon, Jan 06, 2014 at 08:10:04PM -0800, W. Trevor King wrote: Here's an attempted summary of our desires, and my ideal route forward: * Preferred local submodule branches for each superproject branch. * Not currently

Re: Preferred local submodule branches (was: Introduce git submodule attached update)

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 02:36:25PM -0800, W. Trevor King wrote: There are three branches that submodule folks usually care about: 1. The linked $sha1 in the superproject (set explicitly for every superproject commit, and thus for every superproject branch). 2. The remote-tracking

Re: Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-07 Thread W. Trevor King
On Wed, Jan 08, 2014 at 01:17:49AM +0100, Francesco Pretto wrote: # Attach the submodule HEAD to branch. # Also set .git/config 'submodule.module.branch' to branch $ git submodule head -b branch --attach module I prefer submodule.name.local-branch for the submodule's local branch name. I also

Re: Preferred local submodule branches

2014-01-07 Thread W. Trevor King
On Wed, Jan 08, 2014 at 03:12:44AM +0100, Francesco Pretto wrote: 2014/1/8 W. Trevor King wk...@tremily.us: Note that I've moved away from “submodule.name.branch set means attached” towards “we should set per-superproject-branch submodule.name.local-branch explicitly” [1]. Honestly, I'm

Re: Preferred local submodule branches

2014-01-07 Thread W. Trevor King
On Tue, Jan 07, 2014 at 07:47:08PM -0800, W. Trevor King wrote: #git checkout --recurse-submodules master ( # 'git checkout --recurse-submodules' doesn't exist yet [2,3]. # Even with that patch, 'git checkout' won't respect # submodule.name.local-branch without further work

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-08 Thread W. Trevor King
On Thu, Jan 09, 2014 at 12:07:56AM +0100, Francesco Pretto wrote: After long thoughts, I think your idea about a local branch with a differently named remote branch looks interesting but I would be extremely cautious to add a ' submodule.name.local-branch' now. Do we have a similar mechanism

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-08 Thread W. Trevor King
On Thu, Jan 09, 2014 at 12:54:54AM +0100, Francesco Pretto wrote: 2) Having 'git checkout', 'git checkout --recurse-submodules' and finally 'git submodule checkout' is too much for me. Agreed. Since 'git checkout' already exists and 'git checkout --recurse-submodules' is close [1,2], I think

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-08 Thread W. Trevor King
On Thu, Jan 09, 2014 at 02:09:37AM +0100, Francesco Pretto wrote: 2014/1/9 W. Trevor King wk...@tremily.us: [branch my-feature] remote = origin merge = refs/heads/my-feature [submodule submod] local-branch = my-feature and I don't think Git's

[RFC v3 0/4] Preferred local submodule branches

2014-01-08 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us In another branch of the submodule thread Francesco kicked off, I mentioned that we could store the preferred local submodule branch on a per-superbranch level if we used the .git/modules/submodule-name/config for local overrides [1]. Here's a patch series

[RFC v3 3/4] submodule: Teach 'add' about a configurable local-branch

2014-01-08 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us This patch teaches 'git submodule add' to look for a preferred local-branch, and to checkout that branch after the initial clone. The local branch will always point at the commit checked out by the internal 'git clone' operation. For example: $ git

[RFC v3 1/4] submodule: Add helpers for configurable local branches

2014-01-08 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us There are three branches that submodule folks usually care about: 1. The linked $sha1 in the superproject (set explicitly for every superproject commit, and thus for every superproject branch). 2. The remote-tracking submodule.name.branch that tracks

[RFC v3 4/4] submodule: Add a new 'checkout' command

2014-01-08 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us This borrows a good deal of the cmd_foreach logic to iterate through submodules (potentially recursively), checking out the preferred local branch for each submodule (as appropriate for the current superproject branch). Ideally, this logic would be bundled

[RFC v3 2/4] submodule: Teach 'update' to preserve local branches

2014-01-08 Thread W. Trevor King
From: W. Trevor King wk...@tremily.us There's no sense in setting up a local branch if we're just going to go back to a detached HEAD with every checkout-mode update. This commit replaces the checkout with a reset, updating whatever the locally checked out branch (or detached HEAD) happens

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-09 Thread W. Trevor King
On Thu, Jan 09, 2014 at 09:31:13AM +0100, Jens Lehmann wrote: Am 09.01.2014 02:09, schrieb Francesco Pretto: 2014/1/9 W. Trevor King wk...@tremily.us: However, submodule.name.local-branch has nothing to do with remote repositories or tracking branches. My bad: this means the feature

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-09 Thread W. Trevor King
On Thu, Jan 09, 2014 at 08:23:07PM +0100, Jens Lehmann wrote: Am 09.01.2014 18:32, schrieb W. Trevor King: However, the local-branch setting needs to be both per-submodule and per-superproject-branch, so .git/config doesn't work very well. I think it's better to use something like my

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-09 Thread W. Trevor King
On Thu, Jan 09, 2014 at 10:40:52PM +0100, Jens Lehmann wrote: Am 09.01.2014 20:55, schrieb W. Trevor King: On Thu, Jan 09, 2014 at 08:23:07PM +0100, Jens Lehmann wrote: Am 09.01.2014 18:32, schrieb W. Trevor King: However, the local-branch setting needs to be both per-submodule and per

Tight submodule bindings (was: Preferred local submodule branches)

2014-01-11 Thread W. Trevor King
On Wed, Jan 08, 2014 at 10:17:51PM -0800, W. Trevor King wrote: In another branch of the submodule thread Francesco kicked off, I mentioned that we could store the preferred local submodule branch on a per-superbranch level if we used the .git/modules/submodule-name/config for local overrides

Re: Tight submodule bindings

2014-01-13 Thread W. Trevor King
On Mon, Jan 13, 2014 at 08:37:37PM +0100, Jens Lehmann wrote: Am 12.01.2014 02:08, schrieb W. Trevor King: For folks who treat the submodule as a black box (and do no local development), switchable trees are all they care about. They can easily checkout (or not, with deinit), the submodule

Re: Tight submodule bindings

2014-01-13 Thread W. Trevor King
On Mon, Jan 13, 2014 at 02:13:46PM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: Additional metadata, the initial checkout, and syncing down --- However, folks who do local submodule development will care

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-14 Thread W. Trevor King
On Tue, Jan 14, 2014 at 11:24:45AM +0100, Heiko Voigt wrote: On Thu, Jan 09, 2014 at 02:18:40PM -0800, W. Trevor King wrote: Users who are worried about loosing local updates should not be using a checkout-style updates. If they are using a checkout-style update, and they ask for an update

Re: Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-14 Thread W. Trevor King
On Tue, Jan 14, 2014 at 09:58:30PM +0100, Heiko Voigt wrote: A typical workflow where a feature in a project needs some extension or change in a submodule goes like this: 1. The developer does his changes locally implementing everything needed. To commit he creates a local branch in the

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-14 Thread W. Trevor King
On Tue, Jan 14, 2014 at 10:46:08PM +0100, Heiko Voigt wrote: I would like to step back a bit and get back to the original problem at hand: Francescos original use case of an attached head for direct commits on a stable branch in a submodule. How about we finish discussing the exact solution of

Re: [RFC v2] submodule: Respect requested branch on all clones

2014-01-14 Thread W. Trevor King
On Tue, Jan 14, 2014 at 11:19:07PM +0100, Heiko Voigt wrote: On Tue, Jan 14, 2014 at 01:42:09PM -0800, W. Trevor King wrote: The “gitlinked commits must be in the subproject's master” rule protects you from blowing stuff away here. You could use rebase- or merge-style integration as well

Re: [RFC v3 3/4] submodule: Teach 'add' about a configurable local-branch

2014-01-14 Thread W. Trevor King
On Wed, Jan 15, 2014 at 01:18:12AM +0100, Francesco Pretto wrote: I've matured this opinion about local-branch some days ago, but I couldn't join the discussion because I was extremely busy. Hope it's is still current (and correct). I think the discussion is still open, but actions are

[PATCH v4 0/6] submodule: Local branch creation in module_clone

2014-01-15 Thread W. Trevor King
-control.git/240248 W. Trevor King (6): submodule: Make 'checkout' update_module explicit submodule: Document module_clone arguments in comments submodule: Explicit local branch creation in module_clone t7406: Just-cloned checkouts update to the gitlinked hash with 'reset' t7406: Add

[PATCH v4 2/6] submodule: Document module_clone arguments in comments

2014-01-15 Thread W. Trevor King
Signed-off-by: W. Trevor King wk...@tremily.us --- git-submodule.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/git-submodule.sh b/git-submodule.sh index 5e8776c..68dcbe1 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -241,6 +241,12 @@ module_name() # # Clone a submodule

[PATCH v4 1/6] submodule: Make 'checkout' update_module explicit

2014-01-15 Thread W. Trevor King
This avoids the current awkwardness of having either '' or 'checkout' for checkout-mode updates, which makes testing for checkout-mode updates (or non-checkout-mode updates) easier. Signed-off-by: W. Trevor King wk...@tremily.us --- git-submodule.sh | 27 +++ 1 file

[PATCH v4 5/6] t7406: Add explicit tests for head attachement after cloning updates

2014-01-15 Thread W. Trevor King
that don't exist in the upstream subprojects. For a specific example, see the tests that currently generate the 'two_new_submodule_commits' commits. Signed-off-by: W. Trevor King wk...@tremily.us --- t/t7406-submodule-update.sh | 37 + 1 file changed, 37

[PATCH v4 6/6] Documentation: Describe 'submodule update' modes in detail

2014-01-15 Thread W. Trevor King
explicit local branch creation in module_clone. I also add '--checkout' to the usage summary and group the update-mode options into a single set. Signed-off-by: W. Trevor King wk...@tremily.us --- Documentation/git-submodule.txt | 36 +++- Documentation/gitmodules.txt

[PATCH v4 3/6] submodule: Explicit local branch creation in module_clone

2014-01-15 Thread W. Trevor King
. Trevor King wk...@tremily.us --- git-submodule.sh | 53 - 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 68dcbe1..4a09951 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -246,6 +246,9

[PATCH v4 4/6] t7406: Just-cloned checkouts update to the gitlinked hash with 'reset'

2014-01-15 Thread W. Trevor King
To preserve the local branch, for situations where we're not on a detached HEAD. Signed-off-by: W. Trevor King wk...@tremily.us --- t/t7406-submodule-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index

Re: [PATCH v4 1/6] submodule: Make 'checkout' update_module explicit

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 10:46:36AM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: @@ -803,17 +803,10 @@ cmd_update() update_module=$update else update_module=$(git config submodule.$name.update

Re: [PATCH v4 3/6] submodule: Explicit local branch creation in module_clone

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 11:18:00AM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: @@ -312,7 +317,16 @@ module_clone() echo gitdir: $rel/$a $sm_path/.git rel=$(echo $a | sed -e 's|[^/][^/]*|..|g') - (clear_local_git_env; cd $sm_path GIT_WORK_TREE=. git

Re: [PATCH v4 4/6] t7406: Just-cloned checkouts update to the gitlinked hash with 'reset'

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 11:22:52AM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: To preserve the local branch, for situations where we're not on a detached HEAD. Signed-off-by: W. Trevor King wk...@tremily.us --- This should be a part of some other change

Re: [PATCH v4 1/6] submodule: Make 'checkout' update_module explicit

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 09:07:22PM +0100, Francesco Pretto wrote: 2014/1/16 W. Trevor King wk...@tremily.us: Avoiding useless clones is probably more important than avoiding duplicate Invalid update mode messages. No, it's not duplicate code. I meant “duplicating the Invalid update mode

Re: [PATCH v4 6/6] Documentation: Describe 'submodule update' modes in detail

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 12:21:04PM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: @@ -155,13 +155,31 @@ it contains local modifications. update:: Update the registered submodules, i.e. clone missing submodules and - checkout the commit specified

Re: [PATCH v4 3/6] submodule: Explicit local branch creation in module_clone

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 11:43:44AM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: @@ -817,11 +831,15 @@ cmd_update() displaypath=$(relative_path $prefix$sm_path) - if test $update_module = none - then + case

Re: [PATCH v4 6/6] Documentation: Describe 'submodule update' modes in detail

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 09:02:22PM +, John Keeping wrote: On Thu, Jan 16, 2014 at 12:55:21PM -0800, W. Trevor King wrote: On Thu, Jan 16, 2014 at 12:21:04PM -0800, Junio C Hamano wrote: Not '--checkout'? Oops, will fix in v5. Shouldn't this also be `--checkout` (backticks

Re: [PATCH v4 6/6] Documentation: Describe 'submodule update' modes in detail

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 10:18:06PM -, Philip Oakley wrote: From: Junio C Hamano gits...@pobox.com W. Trevor King wk...@tremily.us writes: + repository. The update mode defaults to 'checkout', but be nit: s/but be/but can be/ ? Thanks. Queuing for v5. Cheers, Trevor

Re: [PATCH v4 6/6] Documentation: Describe 'submodule update' modes in detail

2014-01-16 Thread W. Trevor King
On Thu, Jan 16, 2014 at 01:55:37PM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: On Thu, Jan 16, 2014 at 12:21:04PM -0800, Junio C Hamano wrote: W. Trevor King wk...@tremily.us writes: +is only touched when the remote reference does not match the +submodule's HEAD

Re: submodules

2014-01-23 Thread W. Trevor King
On Thu, Jan 23, 2014 at 03:38:49AM -0500, shawn wilson wrote: My issue is in trying to update the submodules, I'm getting: % git submodule update --init gits/kt (master ⚡) swlap1 fatal: reference is not a tree:

[PATCH v5 0/4] submodule: Local branch creation in module_clone

2014-01-26 Thread W. Trevor King
-control.git/240536 [7]: http://article.gmane.org/gmane.comp.version-control.git/240530 W. Trevor King (4): submodule: Make 'checkout' update_module explicit submodule: Document module_clone arguments in comments submodule: Explicit local branch creation in module_clone Documentation: Describe

[PATCH v5 1/4] submodule: Make 'checkout' update_module explicit

2014-01-26 Thread W. Trevor King
This avoids the current awkwardness of having either '' or 'checkout' for checkout-mode updates, which makes testing for checkout-mode updates (or non-checkout-mode updates) easier. Signed-off-by: W. Trevor King wk...@tremily.us --- git-submodule.sh | 27 +++ 1 file

[PATCH v5 3/4] submodule: Explicit local branch creation in module_clone

2014-01-26 Thread W. Trevor King
-by: W. Trevor King wk...@tremily.us --- Documentation/git-submodule.txt | 36 ++--- Documentation/gitmodules.txt| 4 +++ git-submodule.sh| 58 + t/t7406-submodule-update.sh | 39 ++- 4 files

[PATCH v5 4/4] Documentation: Describe 'submodule update --remote' use case

2014-01-26 Thread W. Trevor King
. Trevor King wk...@tremily.us --- Documentation/git-submodule.txt | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 2e1c7a2..21cb59a 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt

[PATCH v5 2/4] submodule: Document module_clone arguments in comments

2014-01-26 Thread W. Trevor King
Signed-off-by: W. Trevor King wk...@tremily.us --- git-submodule.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/git-submodule.sh b/git-submodule.sh index 5e8776c..68dcbe1 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -241,6 +241,12 @@ module_name() # # Clone a submodule

Re: [PATCH v5 1/4] submodule: Make 'checkout' update_module explicit

2014-01-26 Thread W. Trevor King
On Sun, Jan 26, 2014 at 08:32:04PM -0500, Eric Sunshine wrote: On Sun, Jan 26, 2014 at 3:45 PM, W. Trevor King wk...@tremily.us wrote: + update_module=checkout Here, you (unnecessarily) quote 'checkout'... - update_module

Re: [WIP/PATCH 6/9] Teach bisect the --[no-]recurse-submodules option

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:51:57PM +0100, Jens Lehmann wrote: submodule update' eacht time obsolete, which was tedious and error prone. ^ each I'm just reading the commit messages this pass ;). Cheers, Trevor -- This email may be signed or encrypted with GnuPG

Re: [WIP/PATCH 9/9] submodule: teach unpack_trees() to update submodules

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:54:17PM +0100, Jens Lehmann wrote: Implement the functionality needed to enable work tree manipulating commands so that an changed submodule does not only affect the index but it also updates the work tree of any initialized submodule according to the SHA-1 recorded

Re: [WIP/PATCH 7/9] submodule: teach unpack_trees() to remove submodule contents

2014-02-03 Thread W. Trevor King
On Mon, Feb 03, 2014 at 08:52:49PM +0100, Jens Lehmann wrote: Implement the functionality needed to enable work tree manipulating commands to that a deleted submodule should not only affect the index (leaving all the files of the submodule in the work tree) but also to remove the work tree of

Re: [git] Re: [WIP/PATCH 4/9] Teach merge the --[no-]recurse-submodules option

2014-02-07 Thread W. Trevor King
On Fri, Feb 07, 2014 at 02:00:23PM -0800, Junio C Hamano wrote: Jens Lehmann jens.lehm...@web.de writes: I think the user needs to sort things out, just like she has to do when a file has a merge conflict. But unfortunately we cannot use conflict markers here, so I'd propose the following:

Re: Possible regression in master? (submodules without a master branch)

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 03:21:49PM +0100, Johan Herland wrote: I just found a failure to checkout a project with submodules where there is no explicit submodule branch configuration, and the submodules happen to not have a master branch: The docs say [1]: A remote branch name for tracking

Re: Possible regression in master? (submodules without a master branch)

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 08:52:08AM -0700, W. Trevor King wrote: Working around that to default to the upstream submodule's HEAD is possible (you can just use --branch HEAD) Actually, this is probably not a good idea. The initial submodule addition works: $ git submodule add -b HEAD /tmp

Re: [git] Re: Possible regression in master? (submodules without a master branch)

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 06:31:27PM +0100, Jens Lehmann wrote: Am 27.03.2014 18:16, schrieb Junio C Hamano: Johan Herland jo...@herland.net writes: I just found a failure to checkout a project with submodules where there is no explicit submodule branch configuration, and the submodules

submodule.path.branch vs. submodule.name.branch (was: Possible regression in master? (submodules without a master branch).

2014-03-27 Thread W. Trevor King
I'm breaking this off into a sub-thread, so it doesn't distract from the main issue. On Thu, Mar 27, 2014 at 12:39:03PM -0700, Junio C Hamano wrote: There is this bit for update in git-submodule.txt: For updates that clone missing submodules, checkout-mode updates will create submodules

[PATCH] Documentation/submodule: Fix submodule.name - .path typos

2014-03-27 Thread W. Trevor King
to the current submodule.name.branch. Reported-by: Junio C Hamano gits...@pobox.com Signed-off-by: W. Trevor King wk...@tremily.us --- This patch is against master, because 23d25e48 hasn't landed in maint yet. If you want, I can split this into two patches, one against maint fixing the b9289227 typo

Re: [PATCH] Documentation/submodule: Fix submodule.name - .path typos

2014-03-27 Thread W. Trevor King
On Fri, Mar 28, 2014 at 12:15:00AM +0100, Jens Lehmann wrote: Am 27.03.2014 22:06, schrieb W. Trevor King: The transition from submodule.path.* to submodule.name.* happened in 73b0898d (Teach git submodule add the --name option, 2012-09-30), which landed in v1.8.1-rc0 on 2012-12-03. Nope

Re: Possible regression in master? (submodules without a master branch)

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 11:55:21PM +0100, Jens Lehmann wrote: Me thinks that when a superproject doesn't have 'branch' configured and does set 'update' to something other than 'checkout' for a submodule it should better make sure 'master' is a valid branch in there. Everything else sounds like

Re: Re: Possible regression in master? (submodules without a master branch)

2014-03-27 Thread W. Trevor King
On Fri, Mar 28, 2014 at 12:21:23AM +0100, Johan Herland wrote: On Thu, Mar 27, 2014 at 9:27 PM, Heiko Voigt wrote: On Thu, Mar 27, 2014 at 12:39:03PM -0700, Junio C Hamano wrote: There is this bit for update in git-submodule.txt: For updates that clone missing submodules, checkout-mode

[RFC] submodule: change submodule.name.branch default from master to HEAD

2014-03-27 Thread W. Trevor King
submodule.name.branch. Remote updates do need a remote branch, but HEAD works as well here as it did for the initial clone. Reported-by: Johan Herland jo...@herland.net Signed-off-by: W. Trevor King wk...@tremily.us --- This still needs tests, but it gets through the following fine: rm -rf superproject

Re: [RFC] submodule: change submodule.name.branch default from master to HEAD

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 11:43:47PM -0400, Eric Sunshine wrote: On Thu, Mar 27, 2014 at 11:36 PM, W. Trevor King wk...@tremily.us wrote: submodule.name.branch:: A remote branch name for tracking updates in the upstream submodule. - If the option is not specified, it defaults

Re: [RFC] submodule: change submodule.name.branch default from master to HEAD

2014-03-27 Thread W. Trevor King
On Thu, Mar 27, 2014 at 08:52:55PM -0700, W. Trevor King wrote: On Thu, Mar 27, 2014 at 11:43:47PM -0400, Eric Sunshine wrote: On Thu, Mar 27, 2014 at 11:36 PM, W. Trevor King wk...@tremily.us wrote: submodule.name.branch:: A remote branch name for tracking updates

Re: [PATCH] Documentation/submodule: Fix submodule.name - .path typos

2014-03-28 Thread W. Trevor King
On Fri, Mar 28, 2014 at 05:55:18PM +0100, Jens Lehmann wrote: I just noticed that the two patches Junio added to pu have a reworded commit message I'm perfectly happy with. The revised wording works for me too. Cheers, Trevor -- This email may be signed or encrypted with GnuPG

Re: [RFC] submodule: change submodule.name.branch default from master to HEAD

2014-03-28 Thread W. Trevor King
On Fri, Mar 28, 2014 at 05:57:50PM +0100, Jens Lehmann wrote: Am 28.03.2014 04:58, schrieb W. Trevor King: On Thu, Mar 27, 2014 at 08:52:55PM -0700, W. Trevor King wrote: No the remote branch is in the upstream subproject. I suppose I meant “the submodule's remote-tracking branch following

Re: [RFC] submodule: change submodule.name.branch default from master to HEAD

2014-03-31 Thread W. Trevor King
On Mon, Mar 31, 2014 at 09:35:07PM +0200, Jens Lehmann wrote: Am 28.03.2014 04:36, schrieb W. Trevor King: The main drawback to this approach is that we're changing a default, but I agree with John's: On Fri, Mar 28, 2014 at 12:21:23AM +0100, Johan Herland wrote: I expect in most cases

Re: [RFC] t7410: 210 tests for various 'git submodule update' scenarios

2014-04-16 Thread W. Trevor King
On Wed, Apr 16, 2014 at 02:54:48AM +0200, Johan Herland wrote: This is a work-in-progress to flesh out (and promote discussion about) the expected behaviors for all possible scenarios in which 'git submodule update' might be run. This is lovely :). +# - current state of submodule: +#

Re: [RFC] t7410: 210 tests for various 'git submodule update' scenarios

2014-04-17 Thread W. Trevor King
'submodule update' altogether and end up with a simpler interface [2]: On Sat, Jan 11, 2014 at 05:08:47PM -0800, W. Trevor King wrote: * git submodule [--quiet] add [-b branch] [-f|--force] [--name name] [--reference repository] [--] repository [path] * git submodule [--quiet] init

Re: [git] [RFC/PATCH 2/4] Submodules: Add the lib-submodule-update.sh test library

2014-04-17 Thread W. Trevor King
On Tue, Mar 25, 2014 at 06:05:05PM +0100, Jens Lehmann wrote: *) When a submodule is replaced with a tracked file of the same name the submodule work tree including any local modifications (and even the whole history if it uses a .git directory instead of a gitfile!) is simply

Re: [git] What's cooking in git.git (Apr 2014, #03; Fri, 11)

2014-04-17 Thread W. Trevor King
On Fri, Apr 11, 2014 at 03:22:58PM -0700, Junio C Hamano wrote: * jl/submodule-recursive-checkout (2013-12-26) 5 commits - Teach checkout to recursively checkout submodules - submodule: teach unpack_trees() to update submodules - submodule: teach unpack_trees() to repopulate submodules -

Re: [git] [RFC/PATCH 2/4] Submodules: Add the lib-submodule-update.sh test library

2014-04-17 Thread W. Trevor King
On Thu, Apr 17, 2014 at 11:08:06PM +0200, Jens Lehmann wrote: Am 17.04.2014 18:41, schrieb W. Trevor King: On Tue, Mar 25, 2014 at 06:05:05PM +0100, Jens Lehmann wrote: *) When a submodule is replaced with a tracked file of the same name the submodule work tree including any local

Re: [PATCH] tag: add -i and --introduced modifier for --contains

2014-04-21 Thread W. Trevor King
On Mon, Apr 21, 2014 at 05:38:34PM -0700, Luis R. Rodriguez wrote: [0] mcgrof@ergon ~/linux (git::master)$ git log c5905afb..v3.5| grep ^commit | wc -l 24878 [1] mcgrof@ergon ~/linux (git::master)$ git log c5905afb..v3.4| grep ^commit | wc -l 13106 [2] mcgrof@ergon ~/linux (git::master)$

Re: [git] Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 11:20:44AM -0400, Marc Branchaud wrote: On 14-05-01 05:46 AM, brian m. carlson wrote: git checkout maintenance-branch # Update our maintenance branch to the latest from the main repo. git pull --ff-only git pull --no-ff developer-remote topic-branch git

Re: [git] Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 02:16:50PM -0500, Felipe Contreras wrote: The only problem would be when it's not desirable, however, that's a problem of the user's ignorance, and the failure of the project's policity to communicate clearly to him that he should be running `git merge --no-ff`. There's

Re: [git] Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 02:04:33PM -0400, Marc Branchaud wrote: On 14-05-01 01:56 PM, W. Trevor King wrote: On Thu, May 01, 2014 at 11:20:44AM -0400, Marc Branchaud wrote: On 14-05-01 05:46 AM, brian m. carlson wrote: git checkout maintenance-branch # Update our maintenance branch

Re: [git] Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 12:48:46PM -0700, W. Trevor King wrote: My interest in all of the proposed git-pull-training-wheel patches is that they give users a way to set a finger-breaking configuration that makes pull a no-op (or slows it down, like 'rm -i …'). Then folks who compulsively run

Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 06:34:06PM -0500, Felipe Contreras wrote: Nobody ever complained about somebody doing a fast-forward by mistake. Unless they fast-forward merged a feature branch into master, but the project prefers explicitly-merged feature branches with a cover-letter explaination in

Re: [git] Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 06:25:16PM -0500, Felipe Contreras wrote: W. Trevor King wrote: On Thu, May 01, 2014 at 12:48:46PM -0700, W. Trevor King wrote: My interest in all of the proposed git-pull-training-wheel patches is that they give users a way to set a finger-breaking configuration

Re: Pull is Evil

2014-05-01 Thread W. Trevor King
On Thu, May 01, 2014 at 07:37:04PM -0500, Felipe Contreras wrote: W. Trevor King wrote: On Thu, May 01, 2014 at 06:25:16PM -0500, Felipe Contreras wrote: W. Trevor King wrote: Fast-forward $current_branch by $count commits to $repository $refpec? Why would anyone say

Re: [PATCH v6 1/7] pull: rename pull.rebase to pull.mode

2014-05-02 Thread W. Trevor King
On Thu, May 01, 2014 at 07:00:02PM -0500, Felipe Contreras wrote: Also 'branch.name.rebase' to 'branch.name.pullmode'. Perhaps this has already been hashed out in a previous version of this series, but we may want to use pull.update and branch.name.update to match the existing

Re: Pull is Evil

2014-05-02 Thread W. Trevor King
On Thu, May 01, 2014 at 08:14:29PM -0500, Felipe Contreras wrote: W. Trevor King wrote: My proposed --prompt behavior is for folks who think “I often run this command without thinking it through all the way. I'm also not used to reading Git's output and using 'reset --hard

Re: [PATCH v6 5/7] pull: add merge-ff-only option

2014-05-02 Thread W. Trevor King
On Thu, May 01, 2014 at 07:00:06PM -0500, Felipe Contreras wrote: It is very typical for Git newcomers to inadvertently create merges and worst; inadvertently pushing them. This is one of the reasons many experienced users prefer to avoid 'git pull', and recommend newcomers to avoid it as

  1   2   3   4   >