git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Marc Branchaud <marcnarc@xiplink.com>
To: Johan Herland <johan@herland.net>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: RFC: Making submodules "track" branches
Date: Tue, 08 Jun 2010 11:34:34 -0400	[thread overview]
Message-ID: <4C0E630A.7020803@xiplink.com> (raw)
In-Reply-To: <201006080912.31448.johan@herland.net>

On 10-06-08 03:12 AM, Johan Herland wrote:
> 
> There are probably more issues that escape me now...

Thanks for bringing this up!  I'm also very interested in this topic.

The main issue I see is that I don't always want my submodules to track (or
not track) a branch.  What I want changes depending on the circumstances.

One aspect I really like about submodules is the ease of tagging.  I can tag
the super-repo, and know that whenever I checkout that tag I'll always get
the corresponding versions of the submodules as they were when the tag was
made.  It would actually be disastrous, at least in my case, if the
submodules were at the latest HEAD of some branch instead.

This goes for almost any commit in the super-repo's history, not just the
tagged ones:  Whenever I checkout a historical committish, I want to get the
submodules as they were when that commit was made.  Even if I'm working at
the HEAD of some branch, often that branch is based on a historical commit
and I want to use the submodules as they were when that historical commit was
made.

All that said, I do think submodule branch tracking is useful.  Quite often a
development topic will change the super-repo and one or more submodules.  It
would be extremely helpful to do that work in a branch that spans the
super-repo and (a subset of) the submodules.  (In my mind this capability is
one of the main benefits Google's "repo" tool has over submodules.)

So, back to the issue at hand: Sometimes I want static (non-tracking)
submodules, and sometimes I want dynamic (tracking) submodules.  IMO, this
makes Ævar's proposed configuration-based approach impractical.  (Of course,
I'm not looking to replicate svn's externals...)

I'm not sure what the right approach is, but I have some thoughts:

 - Maybe "git branch" should be able to create submodule-spanning branches.

 - If so, then checkout, merge, pull and other branch-related commands should
honor submodule-spanning branches.  "checkout" in particular needs to
distinguish between when it's checking out an actual branch vs. some other
committish, and if the branch being checked out is submodule-spanning it
should checkout the latest HEAD of that branch for the submodules as well.

 - It *may* be good enough to assume that matching branch names in the
super-repo and the submodules are in fact submodule-spanning branches.

 - Automating all this is tricky.  In my super-repo I almost never want to
checkout the master HEAD of all my submodules.  In fact, many of my
submodules are big (e.g. they're different Linux kernels), and are only
needed when building particular things, so that checking all of them out at
once is almost always a huge waste of time.

All this is probably not the kind of feedback you were hoping for!  :)

		M.

  reply	other threads:[~2010-06-08 15:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 23:29 RFC: Making submodules "track" branches Ævar Arnfjörð Bjarmason
2010-06-08  7:12 ` Johan Herland
2010-06-08 15:34   ` Marc Branchaud [this message]
2010-06-08 16:09     ` Ævar Arnfjörð Bjarmason
2010-06-08 19:32       ` Marc Branchaud
2010-06-08 20:23         ` Ævar Arnfjörð Bjarmason
2010-06-09 14:36           ` Marc Branchaud
2010-06-08 16:06   ` Jens Lehmann
2010-06-08 21:52     ` Johan Herland
2010-06-09  7:23       ` Jens Lehmann
2010-06-09  8:22         ` Johan Herland
2010-06-09 12:47           ` Steven Michalske
2010-06-09 14:37             ` Johan Herland
2010-06-08 23:09     ` Junio C Hamano
2010-06-08 23:19       ` Ævar Arnfjörð Bjarmason
2010-06-09  7:09         ` Jens Lehmann
2010-06-09  7:15       ` Jens Lehmann
2010-06-09 15:36         ` Marc Branchaud
2010-06-09 18:54           ` Ævar Arnfjörð Bjarmason
2012-11-20 11:16             ` nottrobin
2012-11-20 12:04               ` W. Trevor King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0E630A.7020803@xiplink.com \
    --to=marcnarc@xiplink.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johan@herland.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).