git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johan Herland <johan@herland.net>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: RFC: Making submodules "track" branches
Date: Wed, 09 Jun 2010 10:22:18 +0200	[thread overview]
Message-ID: <201006091022.18896.johan@herland.net> (raw)
In-Reply-To: <4C0F4185.2000207@web.de>

On Wednesday 09 June 2010, Jens Lehmann wrote:
> Am 08.06.2010 23:52, schrieb Johan Herland:
> > The good thing with Ævar's approach is that this is all configurable
> > per branch (indeed, per commit[1]) by editing your .gitmodules file.
> 
> Yep, I think this is the sane way to do that.
> 
> > Interesting. Will the object parsing machinery handle that without
> > hiccups? What if an older Git version tries to checkout/update a
> > submodule with a 0- hash?
> 
> Maybe Ævar's idea of dropping such a submodule from the tree is better.

Agreed. That will of course cause older Git versions to skip the submodule 
altogether, which is probably the safest failure mode.

> > Me too, but I suspect that if you draw the "one big repo" approach to
> > its logical conclusion, there will be some demand for recursive
> > commits.
> 
> You may be right here. But as submodules often have a detached HEAD, this
> might get interesting ;-)

Yes, trying to recursively commit across a submodule with detached HEAD 
should obviously fail (at least by default). But as long as a local branch 
is checked out in the submodule (which is not necessarily the same as having 
the submodule _track_ that branch), a recursive commit should be relatively 
straightforward.

> > [1]: Say your submodule usually tracks a branch, but you're creating
> > some tag in the super-repo, and you want that tag to uniquely identify
> > the submodule. You achieve this by making sure the tagged commit
> > removes the relevant "branch = whatever" line from .gitmodules, and
> > records the appropriate submodule version in the super-repo tree.
> > Then, you can revert the .gitmodules change on the next commit to
> > resume tracking the submodule branch.
> > 
> > Now, whenever you checkout the tag, you will always get the exact same
> > version of the submodule, although the submodule otherwise tracks some
> > branch.
> 
> Won't work anymore when we would use 0{40} or drop it from the tree.
> AFAICS always-tip and referencing a certain commit don't mix well.

AFAICS, it would still work as long as it exists in the tree for that 
specific commit (but is missing/0{40} in other commits).

We're not mixing "always-tip" and "exact-commit" in the same commit. We use 
"always-tip" in regular commits, and then temporarily switch to "exact-
commit" in the commits where a certain submodule version is required.


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2010-06-09  8:26 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
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 [this message]
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=201006091022.18896.johan@herland.net \
    --to=johan@herland.net \
    --cc=Jens.Lehmann@web.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    /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).