From: Igor Djordjevic <igor.d.djordjevic@gmail.com>
To: phillip.wood@dunelm.org.uk, Alexei Lozovsky <a.lozovsky@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, Johannes Sixt <j6t@kdbg.org>,
Git Mailing List <git@vger.kernel.org>,
Nikolay Shustov <nikolay.shustov@gmail.com>,
Johannes Schneider <mailings@cedarsoft.com>,
Patrik Gornicz <patrik-git@mail.pgornicz.com>,
Martin Waitz <tali@admingilde.org>,
Shawn Pearce <spearce@spearce.org>, Sam Vilain <sam@vilain.net>,
Jakub Narebski <jnareb@gmail.com>
Subject: Re: [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, noworking tree file changes)
Date: Sun, 10 Dec 2017 02:20:12 +0100 [thread overview]
Message-ID: <da74fb2c-c452-4716-91d2-182f945b4254@gmail.com> (raw)
In-Reply-To: <4a92e34c-d713-25d3-e1ac-100525011d3f@talktalk.net>
Hi Philip,
On 09/12/2017 20:01, Phillip Wood wrote:
>
> > But thanks for clarifying, anyway, it does feel like `git rebase
> > -i --autosquash` could be smarter in this regards, if `git rebase
> > --onto` does it better...?
>
> Creating the fixup directly on A rather than on top of B avoids the
> conflicting merge B f!A A. Creating the fixup on top of B and then
> using git commit --onto A would suffer from the same conflicts as
> rebase does.
I`m a bit confused here, as you`re replying to the part where we
strictly discussed `rebase --autosquash` versus `rebase --onto`,
having the latter succeed where the former fails - but you`re
mentioning `git _commit_ --onto` instead, comparing it with `rebase`...
and which one of the two ("--autosquash", I assume)?
Even further, while I do seem to understand (and agree with) what
you`re talking about with `commit --onto` and `rebase --autosquah`
suffering from the same conflicts in attempt to take f!A, originally
created on top of B, and apply it on top of A - the thing is that
Alexei actually pointed to B being the problematic one, failing to
rebase on top of already (successfully) autosquashed A' (where A' = A
+ f!A, fixup applied through --autosquash), while it doesn`t fail
rebasing --onto f!A when f!A is being committed on top of A directly
(and not through --autosquash).
In that (very?) specific case, proposed `git commit --onto-parent`[1]
doesn`t suffer from this, as once f!A is successfully applied onto A
(either squashed in with --amend, or on top of it), we take original
f!A _snapshot_ (not patch!) made on top of B, and just "declare" it
B` (being equal to B + f!A, which we already know, and being
correct), without a need to (try to) apply B patch on top of fixed-up
A to create B', as `rebase` does (and fails).
> I don't think there is any way for 'git rebase --autosquash' to
> avoid the conflicts unless it used a special fixup merge strategy
> that somehow took advantage of the DAG to resolve the conflicts by
> realizing they come from a later commit. However I don't think that
> could be implemented reliably as sometimes one wants those
> conflicting lines from the later commit to be moved to the earlier
> commit with the fixup.
I think I agree on this part being tricky (if possible at all), but I
also think this is not what Alexei was complaining about, nor what we
were discussing (as I tried to explain above) - but please do correct
me if I misunderstood you.
That said, and what I mentioned already, we might really benefit from
simple test case(s), showing "rebase --autosquash" failing where
"rebase --onto" works, as Alexei explained, giving some more (and
firm) context to the discussion.
I *think* I`ve experienced this in the past myself, but now I can`t
seem to wrap my head around a reproducible example just yet... :$
Regards, Buga
[1] https://public-inbox.org/git/4a92e34c-d713-25d3-e1ac-100525011d3f@talktalk.net/T/#m72f45ad7a8f1c733266a875bca087ee82cc781e7
next prev parent reply other threads:[~2017-12-10 1:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 22:35 [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes) Igor Djordjevic
2017-11-26 22:36 ` [SCRIPT/RFC 1/3] setup.sh Igor Djordjevic
2017-11-26 22:36 ` [SCRIPT/RFC 2/3] git-merge-one-file--cached Igor Djordjevic
2017-11-26 22:45 ` [SCRIPT/RFC 3/3] git-commit--onto-parent.sh Igor Djordjevic
2017-11-27 21:54 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes) Johannes Sixt
2017-11-28 1:15 ` Igor Djordjevic
2017-11-29 19:11 ` Johannes Sixt
2017-11-29 23:10 ` Igor Djordjevic
2017-12-01 17:23 ` Johannes Sixt
2017-12-04 2:33 ` Igor Djordjevic
2017-12-06 18:34 ` Johannes Sixt
2017-12-06 18:40 ` Junio C Hamano
2017-12-08 0:15 ` Igor Djordjevic
2017-12-08 16:24 ` Junio C Hamano
2017-12-08 23:54 ` Igor Djordjevic
2017-12-09 2:18 ` Alexei Lozovsky
2017-12-09 3:03 ` Igor Djordjevic
2017-12-09 19:00 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge,noworking " Phillip Wood
2017-12-09 19:01 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, noworking " Phillip Wood
2017-12-10 1:20 ` Igor Djordjevic [this message]
2017-12-10 12:22 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge,noworking " Phillip Wood
2017-12-10 23:17 ` Igor Djordjevic
2017-12-11 1:13 ` Alexei Lozovsky
2017-12-11 1:00 ` Alexei Lozovsky
2017-11-30 22:40 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working " Chris Nerwert
2017-12-03 23:01 ` Igor Djordjevic
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=da74fb2c-c452-4716-91d2-182f945b4254@gmail.com \
--to=igor.d.djordjevic@gmail.com \
--cc=a.lozovsky@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=jnareb@gmail.com \
--cc=mailings@cedarsoft.com \
--cc=nikolay.shustov@gmail.com \
--cc=patrik-git@mail.pgornicz.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=sam@vilain.net \
--cc=spearce@spearce.org \
--cc=tali@admingilde.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).