FR: Abandon files from details view
Is your feature request related to a problem? Please describe.
I regularly want to abandon specific files from a particular revision
Describe the solution you'd like
ability to use a to abandon selected files while in details view
Describe alternatives you've considered
The only way I can find to do this is to split then abandon the new commit.
I've also been doing split to abandon, and agree it would be great to abandon a specific file right from details view.
How is this different than using r to restore files in details view?
I don't follow what you mean. Would you mind elaborating a bit?
Sure.
ability to use
ato abandon selected files while in details view
As I understand it, this means discarding changes made to a file in the revision. That's the equivalent of what r does in the details view. If you select some files and hit r and hit enter then those files will be removed from that revision (effectively changes made to those files will be discarded/abandoned).
Wow. all this time, both vic and I (and surely others) have been going through tremendous complexity to do this...
So, perhaps all that is needed is to rename restore to something else?
I can see that it is calling the jj restore command, which the docs describe it as Restore paths from another revision. And the -c option is specifically Undo the changes in a revision as compared to the merge of its parents. That is, of course, what is necessary and happening. I see no problem with how jj restore is described.
But jjui doesnt expose the flags/options, so just calling it "restore" is evidently confusing - to me, it connotes restoring the currently selected items to somewhere else (eg how the oplog and evolog work).
Perhaps it could be called discard, which is what VS Code calls it even though there's no underlying git discard?
Or, as originally proposed here, to align with the non-details view commands, just call it it abandon? Or restore/abandon? Whether to change the default hotkey from r to a, I'm not sure - it could be disruptive to those who are accustomed to r
Wow. all this time, both vic and I (and surely others) have been going through tremendous complexity to do this...
TIL...
it'd be a good idea to call it abandon with keybind a!
though i do recognize my being unaware of this is due to the fact that i never used jj restore itself...
Ok, interesting. Having two veterans of the jjui missed this feature speaks for itself.
However, I personally find calling an action with a different name than the name of the command that runs confusing and unpredictable. In this context, abandon makes more sense than restore, but restore is also not totally off and it is what's being called under the hood. Most of the jj commands are very flexible and can do more than what their name suggests.
Having a look at the abandon command description, I see the following:
Abandon a revision, rebasing descendants onto its parent(s). The behavior is similar to
jj restore --changes-in; the difference is thatjj abandongives you a new change, whilejj restoreupdates the existing change.
Given the description above, I believe restore is a better match than abandon as it is exactly matching the intent of the r action.
Would a label like restore/abandon be too long?