Here is the next iteration of cloning-update local branch setup.  This
version is based on Francesco's fp/submodule-checkout-mode [1], and
moves back towards the weakly-bound v2 approach and away from the
tightly-bound v3 approach.

The first patch in this series extends that commit to consolidate ''
and 'checkout' update_module values.  I wouldn't mind if that gets
squashed into Francesco's patch.

The meat of the series is in the third patch, which changes the v2
implementation by triggering attached HEADs based on the update-mode
instead of on the existence of a non-empty submodule.<name>.branch
[2].  There has been pushback from both Heiko [3] and Jens [4] on my
mapping checkout updaters to “developers not interested in local
submodule development”, but I still think it's the right
interpretation.  I'm not clear on Heiko or Jens' current possitions,
maybe I've won them over ;).

The other patches in this series are all new in v4.

This still does a double checkout (once in module_clone to create a
local branch, and again in cmd_update to point that branch at the
correct commit), which Heiko was not excited about [5].

I'm also not sure if defaulting to $remote_name/$branch in cmd_update
is appropriate.  cmd_add defaults to using the remote's HEAD, and that
makes more sense to me than defaulting to the master branch.  However,
changing this logic is probably food for another series.

I still think that this series is only useful as a temporary stop-gap
[6] until we get something like my v3 [7], so the appropriate
submodule branch is automatically checked out when you change
superproject branches.



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 explicit tests for head attachement after cloning updates
  Documentation: Describe 'submodule update' modes in detail

 Documentation/git-submodule.txt | 36 +++++++++++++-----
 Documentation/gitmodules.txt    |  4 ++                | 84 +++++++++++++++++++++++++----------------
 t/     | 39 ++++++++++++++++++-
 4 files changed, 121 insertions(+), 42 deletions(-)


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to