Skip to content
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

Reenable lost rebase onto feature from revision grid #10885

Merged

Conversation

pmiossec
Copy link
Member

introduced in v2.44: 324be37
lost in v3.0: a9b7957

but with some improvements:

  • Allow rebase only when one commit is selected
  • Allow rebase onto when 2 commits are selected but only through "advanced options..."
  • Automatically check "Specific range" checkbox when rebase onto
  • Improved logic when using "rebase onto" from the "Commands" menu
    • 1st commit selected is the "from" parameter (that determine the range of commits that will be rebased)
    • 2nd commit selected is the "onto" parameter (on which commit it will be rebased)

Screenshots

Before

When more than one commit selected, we can' rebase (even if some dead code was there to handle it)
image

After

We can do a rebase onto from menu:

image

or from contextual menu:

rebase_onto

Test methodology

  • Manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build 38e120c
  • Git 2.40.0.windows.1
  • Microsoft Windows NT 10.0.22621.0
  • .NET 6.0.15
  • DPI 96dpi (no scaling)
  • Microsoft.WindowsDesktop.App Versions
    Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned pmiossec Apr 14, 2023
GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
GitUI/UserControls/RevisionGrid/RevisionGridControl.cs Outdated Show resolved Hide resolved
GitUI/UserControls/RevisionGrid/RevisionGridControl.cs Outdated Show resolved Hide resolved
GitUI/UserControls/RevisionGrid/RevisionGridControl.cs Outdated Show resolved Hide resolved
GitUI/GitUICommands.cs Outdated Show resolved Hide resolved
@pmiossec pmiossec marked this pull request as draft April 15, 2023 09:07
@pmiossec pmiossec marked this pull request as ready for review April 15, 2023 15:15
GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
@RussKie RussKie added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Apr 16, 2023
@RussKie RussKie added this to the 4.1 milestone Apr 16, 2023
@gerhardol
Copy link
Member

How to document this so the rebase onto is not a hidden feature?
Describe at the form rather than for Browse?
https://git-extensions-documentation.readthedocs.io/en/release-4.0/modify_history.html?highlight=rebase#interactive-rebase

@pmiossec pmiossec force-pushed the rebase_from_revision_grid branch 2 times, most recently from d29880c to 9195739 Compare April 17, 2023 09:18
@pmiossec
Copy link
Member Author

How to document this so the rebase onto is not a hidden feature? Describe at the form rather than for Browse? https://git-extensions-documentation.readthedocs.io/en/release-4.0/modify_history.html?highlight=rebase#interactive-rebase

I have added some documentation in my fork of the documentation repo. You can include it in your PR if you want. Otherwise I will do another PR.

As I don't have python, I have not tested my changes....

@pmiossec
Copy link
Member Author

Finally, I have used docker to check my changes. I pushed a fix and the docker script...

@gerhardol
Copy link
Member

Finally, I have used docker to check my changes. I pushed a fix and the docker script...

Great, will add that in the generic PRR

@gerhardol gerhardol removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Apr 17, 2023
Comment on lines 2062 to 2063
rebaseWithAdvOptionsToolStripMenuItem.Enabled = _rebaseOnTopOf is not null && (selectedRevisions.Count == 1
|| (selectedRevisions.Count == 2 && selectedRevisions.All(r => !r.IsArtificial)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rebaseWithAdvOptionsToolStripMenuItem.Enabled = _rebaseOnTopOf is not null && (selectedRevisions.Count == 1
|| (selectedRevisions.Count == 2 && selectedRevisions.All(r => !r.IsArtificial)));
rebaseWithAdvOptionsToolStripMenuItem.Enabled = _rebaseOnTopOf is not null
&& (selectedRevisions.Count == 1
|| (selectedRevisions.Count == 2 && selectedRevisions.All(r => !r.IsArtificial)));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstv I have applied your suggestion....
Are wee good to go now?

Side note: I need to have my 2 PRs merged before tomorrow otherwise they will have to wait 1 week (AFKB)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be merged now

Side note: I need to have my 2 PRs merged before tomorrow otherwise they will have to wait 1 week (AFKB)

or someone else merge

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or someone else merge

Indeed but I was more thinking about if it needs some changes on my side....

introduced in v2.44: 324be37
lost in v3.0: a9b7957

but with some improvements:
* Allow rebase only when one commit is selected
* Don't allow rebase when rebase onto HEAD is selected
* Allow rebase onto when 2 commits are selected but only through "advanced options..."
* Automatically check "Specific range" checkbox when rebase onto
* Improved logic when using "rebase onto" from the "Commands" menu
	* 1st commit selected is the "from" parameter (that determine the range of commits that will be rebased)
	* 2nd commit selected is the "onto" parameter (on which commit it will be rebased)
@pmiossec pmiossec merged commit 891f788 into gitextensions:release/4.1 Apr 20, 2023
3 checks passed
@pmiossec pmiossec deleted the rebase_from_revision_grid branch April 20, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants