On 21/10/19 11:16AM, Bert Wesarg wrote: > Dear Pratyush, > > I just noticed that the 'Revert Last Hunk' menu entry is enabled in > the stage-list. But I think it should be disabled, like the 'Revert > Hunk' and 'Revert Line' menu entry.
I'm not sure what you mean. There is no "Revert Last Hunk" menu entry (I assume you are talking about the context menu in the diff view that we open by right clicking). My guess is that you mean the "Undo Last Revert" option. And you want it disabled if the diff shown is of a staged file, correct? I'm not sure if disabling it would be a good idea. Say I revert a hunk or line while the file is not staged, and stage the rest of the file. This would mean that file is no longer in the "Unstaged Changes" widget. Now if I choose the file from the "Staged Changes" widget, I get the option to undo the last revert. If I hit that, it will put whatever I reverted in the "Unstaged Changes" widget. So, now part of the file that was reverted is in "Unstaged Changes", and the rest in "Unstaged Changes". IIUC, this is what you think should not happen, correct? What's wrong with allowing the user to undo reverts from anywhere? The way I see it, it doesn't really matter what file is selected or whether it is staged or not, the action of the undo remains the same, so it makes sense to me to allow it from anywhere. > Can you confirm this? > > On Wed, Aug 28, 2019 at 11:57 PM Pratyush Yadav <m...@yadavpratyush.com> > wrote: > > > > Accidental clicks on the revert hunk/lines buttons can cause loss of > > work, and can be frustrating. So, allow undoing the last revert. > > > > Right now, a stack or deque are not being used for the sake of > > simplicity, so only one undo is possible. Any reverts before the > > previous one are lost. > > > > Signed-off-by: Pratyush Yadav <m...@yadavpratyush.com> -- Regards, Pratyush Yadav