Skip to content

Commit

Permalink
FormRebase: select first parent which is a better default selection
Browse files Browse the repository at this point in the history
due to how rebase onto is working
(the selected revision is excluded from the rebase --as it is the "base")

So if the user want to rebase only one commit (which is not so rare),
he only has to validate the selection...
  • Loading branch information
pmiossec committed Apr 14, 2023
1 parent 3634fb8 commit 400d6e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GitUI/CommandsDialogs/FormRebase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ private void btnChooseFromRevision_Click(object sender, EventArgs e)
try
{
AppSettings.ShowStashes = false;
using FormChooseCommit chooseForm = new(UICommands, txtFrom.Text, showCurrentBranchOnly: true);
ObjectId firstParent = UICommands.GitModule.RevParse("HEAD~");
string preSelectedCommit = !string.IsNullOrWhiteSpace(txtFrom.Text) ? txtFrom.Text : firstParent?.ToString() ?? string.Empty;
using FormChooseCommit chooseForm = new(UICommands, preSelectedCommit, showCurrentBranchOnly: true);
if (chooseForm.ShowDialog(this) == DialogResult.OK && chooseForm.SelectedRevision is not null)
{
txtFrom.Text = chooseForm.SelectedRevision.ObjectId.ToShortString();
Expand Down

0 comments on commit 400d6e9

Please sign in to comment.