git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeremy Morton <admin@game-point.net>, git@vger.kernel.org
Subject: Re: Reference a submodule branch instead of a commit
Date: Tue, 4 Oct 2016 13:36:26 +0200	[thread overview]
Message-ID: <20161004113625.GB20309@book.hvoigt.net> (raw)
In-Reply-To: <xmqqfuod6yw2.fsf@gitster.mtv.corp.google.com>

On Mon, Oct 03, 2016 at 12:00:45PM -0700, Junio C Hamano wrote:
> Jeremy Morton <admin@game-point.net> writes:
> 
> > At the moment, supermodules must reference a given commit in each of
> > its submodules.  If one is in control of a submodule and it changes on
> > a regular basis, this can cause a lot of overhead with "submodule
> > updated" commits in the supermodule.  It would be useful of git allows
> > the option of referencing a submodule's branch instead of a given
> > submodule commit.  How about adding this functionality?
> 
> When somebody downstream fetches from your superproject and grabs
> the set of submodules, how would s/he know what _exact_ state you
> meant to record?  When s/he says "I have your superproject commit X,
> which binds submodule's branch Y at path sub/, and it simply does
> not work.  Your project is broken", how do you go about reproducing
> the exact state s/he had trouble with to help her/him?
> 
> The only thing s/he knows is that the commit used from the submodule
> must be one of the commits that was on branch Y at some point in
> time, hopefully close to the timestamp recorded in the commit in the
> superproject.  And your record in the history of the superproject
> does not tell you more than that, so you wouldn't have any idea
> better than what s/he already has to help.
> 
> Hence, such a "functionality" will never happen, at least in the
> exact form you are describing.
> 
> It is conceivable to add some feature that allows you to squelch the
> report that the submodule recorded in your superproject is not up to
> date from "git status" etc. to help those who thinks it is OK to not
> bind the latest submodule commit to the superproject all the time,
> though.

We already have options to support these kinds of workflows. Look at the
option '--remote' for 'git submodule update'.

You then only have to commit the submodule if you do not want to see it
as dirty locally, but you will always get the tip of a remote tracking
branch when updating.

Cheers Heiko

  reply	other threads:[~2016-10-04 11:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 18:14 Reference a submodule branch instead of a commit Jeremy Morton
2016-10-03 19:00 ` Junio C Hamano
2016-10-04 11:36   ` Heiko Voigt [this message]
2016-10-04 17:07     ` Stefan Beller
2016-10-04 17:31       ` Junio C Hamano
2016-10-04 19:01         ` Junio C Hamano
2016-10-05 14:14           ` Heiko Voigt
2016-10-05 16:13             ` Junio C Hamano
2016-10-05 18:21               ` Heiko Voigt

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=20161004113625.GB20309@book.hvoigt.net \
    --to=hvoigt@hvoigt.net \
    --cc=admin@game-point.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).