From: Phillip Wood <phillip.wood123@gmail.com>
To: Elijah Newren <newren@gmail.com>, Alex Henrie <alexhenrie24@gmail.com>
Cc: Tao Klerks <tao@klerks.biz>,
Tao Klerks via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"
Date: Sat, 18 Feb 2023 16:39:40 +0000 [thread overview]
Message-ID: <c3ef69e0-c37a-01fe-a40a-c2940e329793@dunelm.org.uk> (raw)
In-Reply-To: <CABPp-BFxGYQ_JTC5c4_S_gOK3GxWKuZ=KfvycpkBjPGyKzCJ+g@mail.gmail.com>
On 18/02/2023 03:17, Elijah Newren wrote:
> On Thu, Feb 16, 2023 at 8:02 PM Alex Henrie <alexhenrie24@gmail.com> wrote:
>>
>> On Thu, Feb 16, 2023 at 5:31 AM Tao Klerks <tao@klerks.biz> wrote:
>>>
>>> If there's an appetite for it, I would love to contribute to a
>>> multi-year adventure to change git's behavior, little by little, until
>>> the behavior of "rebase=merges" is the default, and the old behavior
>>> becomes a different option like
>>> "rebase=copy-merged-commits-to-flatten"
>>
>> I know you had a lot to say in your last email, but I'd like to focus
>> on this point. I would be OK with the proposed patch if it were part
>> of a larger effort to make --rebase-merges the default behavior of
>> `git rebase`. That seems like an achievable goal, and I don't think it
>> would take multiple years, maybe one year at the most. The process
>> would look something like this:
>>
>> 1. Add a --no-rebase-merges option to `git rebase`.
>>
>> 2. Add a rebase.merges config option.
>>
>> 3. Add a warning to `git rebase` that appears if rebase.merges is
>> unset and neither --rebase-merges nor --no-rebase-merges is given. The
>> warning would advise the user that the default behavior of `git
>> rebase` will change in a future release and suggest setting
>> rebase.merges=no-rebase-cousins to get the new behavior now.
>>
>> 4. Change the `git pull` advice to recommend --rebase=merges and
>> pull.rebase=merges.
>>
>> 5. Wait a couple of releases.
>>
>> 6. Change the default behavior of `git rebase` to `git rebase
>> --rebase-merges` and the default behavior of `git pull --rebase` to
>> `git pull --rebase=merges`. At the same time, remove the warning from
>> `git rebase`. The old `git pull` behavior would still be available as
>> `git pull --rebase=true`.
>>
>> 7. Change the `git pull` advice to recommend the short and simple
>> --rebase option again (leaving the recommendation of
>> pull.rebase=merges for the config option).
>>
>> Does that sound reasonable? I think I could lend a hand with steps 1-3.
>
> One concern I have is that "--rebase-merges" itself has negative user
> surprises in store. In particular, "--rebase-merges", despite its
> name, does not rebase merges. It uses the existing author & commit
> message info, but otherwise just discards the existing merge and
> creates a new one. Any information it contained about fixing
> conflicts, or making adjustments to make the two branches work
> together, is summarily and silently discarded.
That's a good point. Another potentially surprising behavior is that
when I'm rebasing an integration branch with -rno-rebase-cousins then if
one of the topic branches merged into the integration branch happens to
share the same base as the integration branch itself the topic branch
gets rebased as well. -rno-rebase-cousins is also slower that it needs
to be because it creates a todo list that contains all the commits on
the topic branches merged into the integration branch rather than just
the merges. The commits on the topic branches are fast-forwarded rather
than rewritten so long as they don't share the same base as the
integration branch but it noticeably slower than using a todo list with
just the merge commands.
> My personal opinion would be adding such a capability should be step
> 2.5 in your list, though I suspect that would make Tao unhappy (it's a
> non-trivial amount of work, unlike the other steps in your list).
I've got a couple of patches[1] that cherry-pick the merge if only one
of the parents has changed. I've never tried upstreaming them as it is
only a partial solution to the problem of rebasing merges but that
approach should work well with "git pull --rebase=merges" as only the
upstream side will have changed (when rebasing my git integration branch
with that patch the merges are cherry-picked). They might make a useful
starting point if anyone wants to try and improve the rebasing of merges.
Best Wishes
Phillip
[1] https://github.com/phillipwood/git/commits/rebase-cherry-pick-merges
next prev parent reply other threads:[~2023-02-18 16:39 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-05 16:24 [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true" Tao Klerks via GitGitGadget
2023-02-16 3:22 ` Alex Henrie
2023-02-16 12:31 ` Tao Klerks
2023-02-17 3:15 ` Alex Henrie
2023-02-17 11:15 ` Tao Klerks
2023-02-17 18:56 ` Alex Henrie
2023-02-17 17:39 ` Junio C Hamano
2023-02-18 3:17 ` Elijah Newren
2023-02-18 16:39 ` Phillip Wood [this message]
2023-02-20 8:03 ` Tao Klerks
2023-02-20 16:45 ` Phillip Wood
2023-02-20 16:56 ` Elijah Newren
2023-02-21 14:04 ` Tao Klerks
2023-02-22 14:27 ` Sergey Organov
2023-02-24 7:06 ` Elijah Newren
2023-02-24 22:06 ` Sergey Organov
2023-02-24 23:59 ` Elijah Newren
2023-02-25 15:15 ` Sergey Organov
2023-02-25 16:28 ` Elijah Newren
2023-02-26 9:29 ` Sergey Organov
2023-02-27 15:20 ` Elijah Newren
2023-02-27 17:17 ` Sergey Organov
2023-02-28 2:35 ` Elijah Newren
2023-02-20 16:46 ` Elijah Newren
2023-02-20 6:01 ` Tao Klerks
2023-02-20 17:20 ` Elijah Newren
2023-02-20 18:33 ` Alex Henrie
2023-02-21 15:40 ` Tao Klerks
2023-02-21 17:45 ` Alex Henrie
2023-02-21 15:01 ` Tao Klerks
2023-02-24 7:06 ` Elijah Newren
2023-02-28 14:13 ` Felipe Contreras
2023-02-28 20:04 ` Alex Henrie
2023-03-01 12:46 ` Felipe Contreras
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3ef69e0-c37a-01fe-a40a-c2940e329793@dunelm.org.uk \
--to=phillip.wood123@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=alexhenrie24@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=tao@klerks.biz \
/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.
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 NNTP newsgroup(s).