-
Notifications
You must be signed in to change notification settings - Fork 140
rebase -r: support merge strategies other than recursive
#294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rebase -r: support merge strategies other than recursive
#294
Conversation
1bf55c5
to
e671356
Compare
/submit |
Submitted as [email protected] |
This comment has been minimized.
This comment has been minimized.
This branch is now known as |
This patch series was integrated into pu via git@be90704. |
This comment has been minimized.
This comment has been minimized.
This patch series was integrated into pu via git@9643821. |
This patch series was integrated into pu via git@4f09964. |
This patch series was integrated into pu via git@201a12a. |
This patch series was integrated into pu via git@c00c9f6. |
This patch series was integrated into pu via git@bef7796. |
This patch series was integrated into pu via git@c7c300f. |
Since 2185362 (built-in rebase: call `git am` directly, 2019-01-18), the built-in rebase already uses the built-in `git am` directly. Now that d03ebd4 (rebase: remove the rebase.useBuiltin setting, 2019-03-18) even removed the scripted rebase, there is no longer any user of `git-rebase--am.sh`, so let's just remove it. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
One test case's title mentioned the then-current implementation detail that the `--am` backend was implemented in `git-rebase--am.sh`. This is no longer the case, so let's update the title to reflect the current reality. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
This went away in 0609b74 (rebase -i: combine rebase--interactive.c with rebase.c, 2019-04-17). Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
Update a code comment that referred to those files as if they were still there. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
The only remaining scripted part of `git rebase` is the `--preserve-merges` backend. Meaning: there is little reason to keep the "library of common rebase functions" as a separate file. While moving the functions to `git-rebase--preserve-merges.sh`, we also drop the `move_to_original_branch` function that is no longer used. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
The flow of this test script is outright confusing, and to start the endeavor to address that, let's describe what this test is all about, and how it tries to do it. Signed-off-by: Johannes Schindelin <[email protected]>
It still does the very same thing as before, but expresses it in a much more succinct (and still quite readable) manner. Signed-off-by: Johannes Schindelin <[email protected]>
The step to prepare a pre-rebase commit history is _identical_ in _all_ of the test cases (except of course the `setup` case). It should therefore clearly a part of the `setup` test case instead. As the `git filter-branch` command is quite costly on platforms where Unix shell scripting is simply slow (meaning: on Windows), this shaves off a noticeable part of the runtime: in this developer's setup, the time was reduced from ~1m25s to ~1m. Signed-off-by: Johannes Schindelin <[email protected]>
Previously, this test script performed essentially three rebases and verified breakages by testing the post-rebase commits' messages. To do so, the rebases were performed multiple times, though, once per commit message to test. This wastes electricity (and CO2) and time. Let's condense the test cases to the essential number: the number of different rebases to validate. On Windows, where the scripted nature of the `--preserve-merges` backend hurts performance rather badly, this reduces the overall runtime in this developer's setup from ~1m to ~28s while still performing the exact same testing as before. Signed-off-by: Johannes Schindelin <[email protected]>
Apart from the `setup` test case, `t3427-rebase-subtree.sh` is made up exclusively of demonstrations of breakages. The tricky thing about such demonstrations is that they are often buggy themselves. In this instance, somewhere over the course of the six iterations of the patch that eventually made it into Git's `master` as 5f35900 (contrib/subtree: Add a test for subtree rebase that loses commits, 2016-06-28), the commit message "files_subtree/master4" was changed to just "master4", but the test cases still expected the old commit message. Let's fix this, at long last. Signed-off-by: Johannes Schindelin <[email protected]>
This patch series was integrated into pu via git@61d822e. |
This patch series was integrated into pu via git@6adb078. |
This patch series was integrated into pu via git@0c5f2bd. |
This patch series was integrated into pu via git@9ab2e9b. |
This patch series was integrated into pu via git@6187117. |
This patch series was integrated into pu via git@16495a3. |
This patch series was integrated into pu via git@1886162. |
This patch series was integrated into pu via git@79ffd00. |
On the Git mailing list, Elijah Newren wrote (reply to this):
|
This patch series was integrated into pu via git@be46f04. |
This patch series was integrated into pu via git@14950d8. |
This patch series was integrated into next via git@71e2451. |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
This patch series was integrated into pu via git@4537165. |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into pu via git@aa2d3a6. |
This patch series was integrated into pu via git@1b55d3b. |
This patch series was integrated into pu via git@917a319. |
This patch series was integrated into master via git@917a319. |
Closed via 917a319. |
This is the most notable shortcoming that
--rebase-merges
has, still, relative to--preserve-merges
' capabilities: it does not support passing custom merge strategies or custom merge strategy options.Let's fix this.
While working on this patch series, of course I tried to copy-edit the test cases we have, to cover
--preserve-merges
' support for merge strategies. Oh my, did I regret this decision as soon as my eyes set sight ont3427-rebase-subtree.sh
!At first I tried my best to make heads or tails of t3427, for way too long. In the end the only way to understand what the heck it tries to do was to actually fix it. That's why this patch series looks as if it focuses on t3427 rather than on adding support for custom merge strategies to the
--rebase-merges
mode.As a consolation to myself, this work was actually worth it, surprising as that may look. Not only is t3427 now really easy to understand, adding that test case for
--rebase-merges -Xsubtree
tickled the sequencer enough to reveal a long-standing bug: the--onto
option was simply ignored when passed together with--rebase-merges
and--root
. For good measure, this patch series addresses this bug, too.Changes since v1:
js/rebase-cleanup
: that branch itself was rebased, and as a consequence, one already-applied patch was dropped from this patch series.fakesha
handling, just in case that anybody wants to use it with a regularpick
command in the future (thanks, brian).Cc: brian m. carlson [email protected]