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
RevisionDiff: Stage/Unstage selected lines #7825
Conversation
cd90545
to
8f65c7b
Compare
8f65c7b
to
e08f690
Compare
CodeFactor complains about complexity for a function with case (3 more added by new hotkeys). I do not see a good way to rewrite that. |
Don't worry about it
|
e08f690
to
db6109b
Compare
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.
Stage/untage file/selected lines
seem to work well. But the hotkeys are not shown for the FileStatusList.
Reset selected lines
works with the same limitations as in FormCommit -- OK.
I have finished the review of the -- well separated -- commits except the main one db6109b. I'll have a look at it later.
The next thing I really like to have, is that the hotkeys work from the RevisionGrid, too, because it gets focused when switching the artificial commits.
Though before we duplicate the hotkeys as for F3
, we should rework the hotkey handling completely.
I cannot why they do not appear...
and/or hotkeys for switching between worktree/index, or global keys to select worktree/index and view RevDiff
The main commit is e9ae2d4. db6109b is separate as #7831 required changes after this was submitted. All commits should be squashed when merged |
e39e71b
to
bc32d50
Compare
👍 That's the use case. Of course, for 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.
Several nits and
The hotkey handling for Reset file(s) to | First
is too restrictive: It often does not have any effect although the menu item works as expected.
9fa8ed7
to
798e9fa
Compare
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.
R
works for file as expected now. I guess I had not built everything last time.
One final nit.
798e9fa
to
3e70a49
Compare
I have seen this too, since around the time SDK style project was merged. (I did report this in a comment, probably my worst issue description ever). It seem to occur more often if I have not saved before Start/F5, but there has been situations where I thought I saved too. Dont know how to proceed with that. |
There are some things I am not so happy about with this PR. Replace ViewCurrentChanges with ViewChangesAsync - to unify Another is the handling of SelectedDiff.CherryPickContextMenuEntry_Visible(); in TextLoaded. If the file to view is stored in FileViewer as GitItemStatusWithParent then that handling can be built in, as well as the patch handling that currently is slightly duplicated in FileViewer, FormCommit and RevisionDiffControl. |
3e70a49
to
e6eb629
Compare
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.
Go ahead!
The merge problems was in the private branch only that I had not pushed in a while. |
The "Add selection to commit message" command is inserted to the FileViewer menu, which is confusing. Other inserted entries are removed in gitextensions#7825. A proper redesign could be done with enabling and eventhandlers, but usage is considered low and workaround is to copy&paste.
The "Add selection to commit message" command is inserted to the FileViewer menu, which is confusing. Other inserted entries are removed in gitextensions#7825. A proper redesign could be done with enabling and eventhandlers, but usage is considered low and workaround is to copy&paste.
ba2ebaf
to
52de36e
Compare
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.
LGTM. Only nits. Will run it later.
52de36e
to
ebb4811
Compare
Rebased on latst #8708 , review comments addressed and a fixup of my own |
ebb4811
to
7acf708
Compare
Squashed review comments (but not my unreviewed changes) and rebased on master, removed WIP now when #8708 is merged |
Since @mstv is happy, let's merge it :) |
Will merge after #8734 Now I only miss a way to change the commit message for Index commit and a commit button to skip the modal commit dialog in most situations |
7acf708
to
d4a87db
Compare
Move handling of stage/unstage/reset line patching from FormCommit to FileViewer. Instead of FormCommit adding menu items to FileViewer, handle the actions directly in FileViewer, including the hotkey handling. Also hotkey for cherry-pick and reset line patches. This also aligns the stage/reset menu items to other forms. Apply the line patching also to RevDiff, supporting line patches for worktree/index properly, including hotkey handling. When manipulating a diff with an artificial commit, refresh the diff after patching. Some code cleanup, like using ViewChangesAsync consistently for diffs/patches FormCommit; Use common method for head revisions Set parents for artificial revisions
d4a87db
to
37ac053
Compare
Squashed and rebased after #8734 with a minor removal ofunused code in FormCommit:ShowChanges() |
@msftbot merge in 3 days |
Hello @gerhardol! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Fixes #7338
Based on #8708
Proposed changes
Move handling of stage/unstage/reset line patching from FormCommit to FileViewer.
Instead of FormCommit adding menu items to FileViewer, handle
the actions directly in FileViewer, including the hotkey handling.
Also hotkey for general stage/reset lines (previously cherry-pick and revet line patches).
This also aligns the stage/reset menu items to other forms.
Apply the line patching also to RevDiff, supporting line patches for
worktree/index properly, including hotkey handling.
When manipulating a diff involving an artificial commit, refresh the diff
Some code cleanup, like using ViewChangesAsync consistently for diffs/patches
This is a step to avoid using FormCommit to prepare commits
Screenshots
For WorkTree, Similar for Index
Normal commits gets hotkeys and changed Copy grouping too
Before
After
Test methodology
Manual
✒️ I contribute this code under The Developer Certificate of Origin.