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

Add git stash --staged #9848

Merged
merged 4 commits into from Feb 6, 2022
Merged

Conversation

mstv
Copy link
Member

@mstv mstv commented Jan 31, 2022

Fixes #9839

Proposed changes

  • Add git stash --staged command to FormBrowse and to FormCommit
    if Git version is >= 2.35.0
  • Recommend this version of Git

My use case: Occasionally, I want to swap staged and unstaged, e.g. if the previous commit needs to be amended or when something different is to be committed urgently.

Screenshots

Before

image

image

After

image

image

Test methodology

  • manual

Test environment(s)

  • Git Extensions 33.33.33
  • Build 0fe73fa
  • Git 2.35.1.windows.1
  • Microsoft Windows NT 10.0.19044.0
  • .NET 5.0.12
  • DPI 96dpi (no scaling)

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.

@mstv mstv self-assigned this Jan 31, 2022
GitUI/CommandsDialogs/FormBrowse.cs Outdated Show resolved Hide resolved
GitUI/CommandsDialogs/FormCommit.cs Outdated Show resolved Hide resolved
@@ -1178,11 +1180,25 @@ private void InitializeComponent()
this.ResetAuthor.UseVisualStyleBackColor = true;
this.ResetAuthor.Visible = false;
//
// StashStaged
Copy link
Member

Choose a reason for hiding this comment

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

These controls should be in the bottom of the side.
Mono did not support that setup, why it was like this originally.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted to only insert StashStaged.
Have I got it right?
Should the private Button ResetUnStaged; be moved up to the section with the other Buttons, too?

@ghost ghost added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Feb 1, 2022
@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Feb 1, 2022
@@ -266,7 +266,7 @@ public FormBrowse(GitUICommands commands, BrowseArguments args)
MainSplitContainer.Visible = false;
MainSplitContainer.SplitterDistance = DpiUtil.Scale(260);

stashStagedToolStripMenuItem.Visible = GitVersion.Current.SupportStashStaged;
stashStagedToolStripMenuItem.Visible = Module.GitVersion.SupportStashStaged;
Copy link
Member

Choose a reason for hiding this comment

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

Also need to be moved to InternalInitialize() as it may change when the module is updated.
A change still required to GitVersion, this was the first change that affected a supported setup...

Check for WSL Git version was always using Windows version
@gerhardol
Copy link
Member

I pushed changes to a private branch.
WSL could be a separate PR

@mstv mstv merged commit 4851362 into gitextensions:master Feb 6, 2022
@ghost ghost added this to the vNext milestone Feb 6, 2022
@mstv mstv deleted the feature/9839_stash_staged branch February 6, 2022 12:33
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.

Support for git stash --staged
3 participants