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
FormCommit: Add soft reset for amending #10699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of adding more controls to this panel - it is already too "bisy". Other than that, it looks ok.
This (checkbox and) button are invisible until |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Agree to this behavior, something "virtual" showing the complete change without an actual reset is too complicated.
Very brief review though. The enabling of Amend seem to be the change to focus on...
547fb5f
to
53e1a48
Compare
Let's take it! I will annoy you with a UI layout change later 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving but it'd be great to add some tests.
Why do you expect this? Are you going to break the workflow
I came to the same conclusion when I was testing it manually. The |
We do have some existing test for the Commit dialog, where (iirc) we stage
and unstage files. Did you check those?
I can try to help you, if you have a failing test, but I can't promise any
timeline atm - my work keeps me really busy...
|
One needs to call |
53fd3f6
to
16249e8
Compare
13f1902
to
a5b0156
Compare
I'm kind of wondering - do we need the "soft reset" button at all? Shouldn't we just execute it when "amend" is ticked? That is, if a user chose to amend, it's logical to assume he/she'd want to see the amended files? Or am I overthinking it? The other question I have (I apologise, I haven't had a chance to try this branch) is about the experience when the user closes the dialog after soft resetting and not committing the changes, or simply changes the mind about amending. What are we doing with the soft-reset files? |
You have already answered it yourself: "... changes the mind about amending. What are we doing with the soft-reset files?" |
I often toggle amend box to get the commit message to edit it for a squash (or amend! now when I know about it) (instead of using ctrl-x and changing the message) |
I do check the box a lot, similar to @gerhardol. I wonder if this functionality can be approached a little differently. That is, when the box is checked we automatically read HEAD~1 content and display it in the "staged" area. This would allow to review the content. These files can be marked differently - e.g., they can't be immediately unstaged or reset. |
Showing head~1 in staged would be confusing. A third read only file list could be shown but that will still not show all changes to a file in this list. I often use browse for such manipulations when i do not want to amend just getting an overview for a fixup. Soft reset is good enough for now. |
What if they reset soft and then change their minds? Uncheck ammend after soft reset? |
They need to commit again (or use the reflog). |
a5b0156
to
fd0619b
Compare
Till they open commit window again? They could merge commits by:
|
This soft reset needs three clicks by default, Jay. We cannot take responsibility of all user clicks. The reflog is still there. One can squash commits using this with reopening FormCommit. :) |
Yep. More documenting exactly that in the ticket so when someone comes
around
....but why...how do I... Already in ticket.
|
One more. Have you tried with a skip work tree file that is in commit? |
I have not. But very likely, the file will not be committed as git was told so. |
Fixes #2260
Proposed changes
Reset soft
button for amending a commitAmend commit
checkbox only after Soft Reset, not in dependency of stagingReferenceRepository
: Write git index (LibGitSharp does not do this automatically)Reset.Enabled
andCommitAndPush.Text
)Screenshots
Before
After
Test methodology
ReferenceRepository
Test environment(s)
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.