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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 05, 2014 at 01:47:52PM -0800, W. Trevor King wrote:
> On Sun, Jan 05, 2014 at 10:27:19PM +0100, Francesco Pretto wrote:
> > 2014/1/5 W. Trevor King:
> > Also it covers:
> > - an "autoremote" behavior when the user wants an attached HEAD:
> > with your patch "--remote" is still needed to really update the
> > branch with "git submodule update":
> > - voluntary reattach/detach the HEAD with command line;
> > - ff-only merge of changes in the case of "checkout" in an attached
> > HEAD (doing "git checkout <branch>" is not enough);
> > - reattach of the HEAD with orphaned commits.
> 
> Personally, I don't think autoremote updates are worth the additional
> UI complication (hence my alternative patch ;), but I'm open to
> discussion on this point.  Can you make a case for why and explicit
> --remote update is burdensome?
> 
> I'm also not entirely clear on the problems avoided or workflows
> enhanced via the last two entries.  Could you sketch an example
> workflow that makes that more obvious?

For example, your original patch [1] claimed a reduction from:

  # Maintainer
  $ git submodule add --branch "master-project1" <repository> common
  $ git commit -m "Added submodule"
  $ git config -f .gitmodules submodule.common.ignore all
  $ git push
  $ cd <path>
  $ git checkout "master-project1"

to:

  # Maintainer
  $ git submodule add --branch "master-project1" --attach <repository> <path>
  $ git commit -m "Added submodule"
  $ git push

My patch does not effect this maintainer flow at all, but I'm pretty
sure the initial checkout is already automatic:

  $ git --version
  git version 1.8.3.2
  $ cd b/
  $ git init
  Initialized empty Git repository in /tmp/b/.git/
  $ git submodule add --branch master ../a
  Cloning into 'a'...
  done.
  Checking connectivity... done
  $ cd a/
  $ git branch
  * master

You also claimed a reduction from:

  # Developer
  $ git pull
  $ git submodule init
  $ git submodule update --remote
  $ cd <path>
  $ branch="$(git config -f ..\.gitmodules submodule.common.branch)"; git checkout $branch

to:

  # Developer
  $ git pull
  $ git submodule init
  $ git submodule update

My patch should cover the developer reduction (auto branch checkout on
the initial cloning update) without confusing the situation with
autofloated updates.

Cheers,
Trevor

[1]: http://article.gmane.org/gmane.comp.version-control.git/239799

-- 
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

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]