git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Derrick Stolee <stolee@gmail.com>, Jeff King <peff@peff.net>,
	Edmundo Carmona Antoranz <eantoranz@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC/PATCH 1/2] rebuash - squash/rebase in a single step
Date: Tue, 2 Jul 2019 21:30:07 +0200	[thread overview]
Message-ID: <e8a39f00-7f88-7c32-ac18-12f17faf2c72@kdbg.org> (raw)
In-Reply-To: <xmqqr2784alt.fsf@gitster-ct.c.googlers.com>

Am 02.07.19 um 19:20 schrieb Junio C Hamano:
> Derrick Stolee <stolee@gmail.com> writes:
> 
>> On 7/1/2019 2:35 PM, Junio C Hamano wrote:
>>> Jeff King <peff@peff.net> writes:
>>>
>>>>> First, we create a (temporary) merge commit of both branches (M3)
>>>>>
>>>>> ------------
>>>>> 	R1---R2---R3---R4---R5---R6---R7---M3
>>>>> 	 \         \              \       /
>>>>> 	  F1---F2---M1---F3---F4---M2---F5
>>>>> ------------
>>>>>
>> ...
>>> If M3 merge is always easier to manage than incremental stepwise
>>> rebase of the topic, then doing the "git merge --reverse-squash"
>>> would be a saner interface and also conceptually simpler.
>>
>> I agree that this would be a better way to expose this behavior,
>> and likely the implementation could be very clean.
> 
> What I was sort-of hoping to get comments on was actually something
> else.
> 
> Would there be cases where the merge M3 gets unmanageably complex
> even if rebasing the feature commits one by one is relatively simple
> (and how often would that happen)?  "merge --squash" would not work
> well (and extending the command to merge in a different direction
> would not help) in such a situation, but "rebase -i" would work
> much better (and "imerge" would, too).

I've come across the situation occasionally. Once I have resolved a
bunch of conflicts in M1 and M2, I think twice whether I should rebase
individual commits; it is typically much more tedious.

A common situation is that a line is "A" in F1, "B" in F2, and "C" in
R3; then I have to resolve ONE conflict in M1 ("<B=C>"), but with
individual commits rebased on top of R3, I have two conflicts, "<C=A>"
and "<AC=B>", neither of which is helped by rerere.

After merges M1 and M2, it is all a done deal, and M3 is typically a
much simpler merge than the sum of conflicts incurred by the individual
commits. I would generally not recommend a rebase in this situation.

But I wouldn't turn M3 into a squashed merged commit, either, as long as
F1...F5 aren't messy.

-- Hannes

      reply	other threads:[~2019-07-02 19:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-30  5:18 [RFC/PATCH 1/2] rebuash - squash/rebase in a single step Edmundo Carmona Antoranz
2019-06-30  5:18 ` [RFC/PATCH 2/2] rebuash - support for status Edmundo Carmona Antoranz
2019-06-30  5:28   ` Edmundo Carmona Antoranz
2019-06-30  6:53 ` [RFC/PATCH 1/2] rebuash - squash/rebase in a single step Jeff King
2019-06-30 15:09   ` Edmundo Carmona Antoranz
2019-06-30 22:39     ` Jeff King
2019-07-01  1:37       ` Edmundo Carmona Antoranz
2019-07-01 18:50         ` Junio C Hamano
2019-07-01 20:48           ` Edmundo Carmona Antoranz
2019-07-01 18:35   ` Junio C Hamano
2019-07-02 11:37     ` Derrick Stolee
2019-07-02 17:20       ` Junio C Hamano
2019-07-02 19:30         ` Johannes Sixt [this message]

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=e8a39f00-7f88-7c32-ac18-12f17faf2c72@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=eantoranz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=stolee@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.
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).