From: Stefan Beller <sbeller@google.com>
To: Carlo Wood <carlo@alinoe.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Heiko Voigt <hvoigt@hvoigt.net>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git push failing when push.recurseSubmodules on-demand and git commit --amend was used in submodule.
Date: Sat, 4 Feb 2017 10:43:56 -0800 [thread overview]
Message-ID: <CAGZ79kYXc-cT-059ZpoVrUjLodY-x61bW2ANQqtcAQLzGiRZ3A@mail.gmail.com> (raw)
In-Reply-To: <20170201021040.4f6cc827@hikaru>
On Tue, Jan 31, 2017 at 5:10 PM, Carlo Wood <carlo@alinoe.com> wrote:
> On Tue, 31 Jan 2017 14:08:41 -0800
> Stefan Beller <sbeller@google.com> wrote:
>
>> On Sun, Jan 29, 2017 at 5:00 PM, Junio C Hamano <gitster@pobox.com>
>> wrote:
>> > 2. If the amend is good and ready to go, "git add" to update the
>> > superproject to make that amended result the one that is needed
>> > in the submodule.
>>
>> yup.
>
> But that is what I am doing. The amended commit IS already
> added to the superproject (and pushed to the remote).
>
> Please have a look at my script, this happens here:
>
> # Correct that in the parent too:
> pushd parent
> git add subm
> git commit -m 'Updated subm.'
> popd
And if you were to use ammend here, too; there would be no problem;
In the parent there are now two commits, the first one pointing at the
first (unammended) commit in the submodule, the second pointing to
the corrected commit.
>
> The commit from before the amend was added to the super
> project (but never pushed) but has now been completely
> replaced. I still think this is a flaw in git. It shouldn't
> not complain and simply push.
The problem here is in the design.
When "on-demand" is set, the parent repo determines which
sumbodules needs pushing, then runs a plain "git push" in them
and then checks again.
The push operation in the submodule did not push out the un-amended
commit (which is correct IMO).
The parent in the second check determines that there is a commit, that
is not pushed, though. Maybe we need an option there "on-demand-but-no-recheck"
as a weaker promise what Git can deliver there.
>
> --
> Carlo Wood <carlo@alinoe.com>
next prev parent reply other threads:[~2017-02-04 18:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-29 19:33 git push failing when push.recurseSubmodules on-demand and git commit --amend was used in submodule Carlo Wood
2017-01-30 1:00 ` Junio C Hamano
2017-01-31 22:08 ` Stefan Beller
2017-02-01 1:10 ` Carlo Wood
2017-02-04 18:43 ` Stefan Beller [this message]
2017-02-01 1:22 ` Carlo Wood
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=CAGZ79kYXc-cT-059ZpoVrUjLodY-x61bW2ANQqtcAQLzGiRZ3A@mail.gmail.com \
--to=sbeller@google.com \
--cc=carlo@alinoe.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.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).