git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Hedges Alexander <ahedges@student.ethz.ch>,
	"git\@vger.kernel.org" <git@vger.kernel.org>,
	Jacob Keller <jacob.keller@gmail.com>,
	Lars Schneider <larsxschneider@gmail.com>
Subject: Re: Feature Request: Branch-Aware Submodules
Date: Thu, 25 Aug 2016 14:25:32 -0700	[thread overview]
Message-ID: <xmqqd1kwlewj.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79ka60e2Y87k6oKtTN9e0ZexHx2GfJ7yfhvyQon_VgbUgNA@mail.gmail.com> (Stefan Beller's message of "Thu, 25 Aug 2016 13:55:59 -0700")

Stefan Beller <sbeller@google.com> writes:

>>> So you roughly do
>>>
>>>     git checkout -b new-topic
>>>     # change the submodule to point at the latest upstream version:
>>>     git submodule update --remote <submodule-path>
>>>     git commit -a -m "update submodule"
>>>     git checkout master
>>>     git merge new-topic
>>>     # here seems to be your point of critic?
>>>     # now the submodule pointer would still point to the latest
>>> upstream version?
>>
>> Isn't <submodule-path> subject to the usual 3-way merge when the
>> last step (i.e. a merge of new-topic branch into master in the
>> superproject) is made?  If 'master' hasn't changed <submodule-path>
>> since 'new-topic' forked from it, because 'new-topic' updated the
>> commit bound at <submodule-path>, doesn't "git merge new-topic" just
>> take that change as the normal "One side updated, the other did not
>> touch; take the update" merge?
>
> Yes. I was unclear here.
> By "latest upstream version" I meant the version you pulled in in the new-topic
> branch via the "submodule update --remote" and that is preserved as is.

I do not think you were unclear at all.

What else is desired?  "git merge new-topic" leaves a result that is
not a merge of the changes made on that new-topic branch, by leaving
a stale <submodule-path> that was in 'master' as-is?

After all, the new-topic branch committed that "update submodule",
showing its desire that the latest-from-upstream commit it just
obtained must be at <submodule-path> from then on in the top-level
project.  If that change is not propagated (or at least "taken into
account") when merging it to 'master', the result is not a proper
"merge".  If new-topic didn't want the updated commit from the
submodule, it shouldn't have recorded that in its commit in the
first place.


  reply	other threads:[~2016-08-25 21:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25  9:00 Feature Request: Branch-Aware Submodules Hedges  Alexander
2016-08-25 17:45 ` Stefan Beller
2016-08-25 20:50   ` Junio C Hamano
2016-08-25 20:55     ` Stefan Beller
2016-08-25 21:25       ` Junio C Hamano [this message]
2016-08-25 17:46 ` Junio C Hamano
     [not found] <5EA7D232-5D41-4653-9E35-21C502C79C92@student.ethz.ch>
2016-08-26 15:12 ` Hedges  Alexander
2016-08-29  2:17   ` Jacob Keller
2016-09-01 11:34     ` Hedges  Alexander

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=xmqqd1kwlewj.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=ahedges@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=larsxschneider@gmail.com \
    --cc=sbeller@google.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).