From: "Andreas T.Auer" <andreas.t.auer_gtml_37453@ursus.ath.cx>
To: Phil Hord <phil.hord@gmail.com>
Cc: Jens Lehmann <Jens.Lehmann@web.de>, git@vger.kernel.org
Subject: Re: Auto update submodules after merge and reset
Date: Sun, 11 Dec 2011 22:15:39 +0100 [thread overview]
Message-ID: <4EE51D7B.7020806@ursus.ath.cx> (raw)
In-Reply-To: <CABURp0rcT2FR3uOmhyPUV5W3pu7WuJzjXktmUq0eb4nOiUwDKA@mail.gmail.com>
On 10.12.2011 00:57 Phil Hord wrote:
> On Thu, Dec 8, 2011 at 4:13 AM,
> <andreas.t.auer_gtml_37453@ursus.ath.cx> wrote:
>
> Yes, but maybe you can update this information in the .gitmodules
> file easily with a command. Maybe it could be something simpler
> than "git sync-gitmodules-branches", but that is essentially what it
> would do: it would save the current branch in each submodule as the
> "tracked" branch in the .gitmodules file.
Ok, I have read a better description of the "floating submodule" model
now, so it is a different use case and somehow it makes sense. In that
case there are probably just a few branches that you would like to
follow, maybe an "unstable" for the newest development or "stable" for
the current release or some maintenance branches.
> Now this makes sense. I want the same thing. I want to preserve
> history on "old" commits, but I want to "advance to tip" on "new"
> commits.
>
> The trouble, I think, is in telling the difference between "old" and
> "new". I think it means there is a switch, like --auto-follow (or
> --no-auto-follow for the alternate if core.auto_follow is set). But
> having a config option as the default is likely to break lots of
> scripts.
In my use case the branches on the submodules follow the superproject
and (mostly) versions that are committed there, it just adds the
possibility to keep on working without checking out a branch after an
update and without colliding with existing branchnames in the submodule.
The other use case wants to follow the commits of that other submodule
without checking the corresponding gitlinks into the superproject. But
wouldn't it also make sense here to define actually a mapping in the
.gitmodule that says "if the branch 'develop' is checkedout in the
supermodule then with every submodule update automatically pull the
newest 'unstable' commit from the submodule"? Or for "master" follow
"stable" or for the "maint" branch follow updates in the "bugfixes" branch.
For example
[submodule "commonlib"]
update = heads develop:unstable master:stable maint:bugfixes
So whenever a defined branch is checked out in the superproject the
mapped branch will be checked out in the submodule ("new" commit), but
if a (e.g. tagged) commit is checked out ("old" commit) then the gitlink
in the superproject is used to check out the referenced commit in the
submodule.
In http://thread.gmane.org/gmane.comp.version-control.git/183837 was
discussed whether the gitlink in the superproject should be set to
all-zero if updates follow the tip or maybe use the SHA1 of the commit
when the submodule was added. I think the gitlink should be updated
everytime when a new commit in the superproject is created.
next prev parent reply other threads:[~2011-12-11 21:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 0:55 Auto update submodules after merge and reset Max Krasnyansky
2011-11-30 8:31 ` Jens Lehmann
2011-12-06 1:06 ` Max Krasnyansky
2011-12-06 21:32 ` Jens Lehmann
2011-12-07 9:07 ` Andreas T.Auer
2011-12-07 22:23 ` Jens Lehmann
2011-12-08 9:13 ` andreas.t.auer_gtml_37453
2011-12-09 23:57 ` Phil Hord
2011-12-10 1:41 ` Andreas T.Auer
2011-12-11 14:43 ` Phil Hord
2011-12-11 21:15 ` Andreas T.Auer [this message]
2011-12-12 22:39 ` Jens Lehmann
2011-12-12 23:43 ` Phil Hord
2011-12-13 7:52 ` Jens Lehmann
2011-12-13 9:45 ` Andreas T.Auer
2011-12-13 21:44 ` Jens Lehmann
2011-12-13 23:05 ` Andreas T.Auer
2011-12-14 15:16 ` Marc Branchaud
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EE51D7B.7020806@ursus.ath.cx \
--to=andreas.t.auer_gtml_37453@ursus.ath.cx \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=phil.hord@gmail.com \
/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.
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 NNTP newsgroup(s).