Community
Participate
Working Groups
When I stash some changes I'd like to preview them before applying back, or just knowing whether it's safe to drop them. Unfortunately that's not possible, since the commit editor has no 'Diff' tab and double-clicking on a changed file pops up a dialog which says "This is a merge commit with more than once ancestor". With the cgit CLI, I can use git show or git stash show -p. With EGit, there is no such possibility.
Created attachment 243707 [details] screenshot of commit editor when opening a stashed commit
Created attachment 243990 [details] Proposed redesign for stash commit viewer
Created attachment 243991 [details] Current commit viewer
comments for https://git.eclipse.org/r/#/c/28037/2 nice improvement :-) Good idea to mimic staging view to display stash details. Though a few things should be fixed to make the stash view more consistent with the staging view: - The git decorators in the stash commit viewer don't match the corresponding decorators shown by staging view before creating the stash. I think this should be fixed, see the attached screenshot - The sort order of files shown in stash commit viewer doesn't match the sort order shown in staging view, see screenshot. - Double click on a file in the staging view opens a compare view, double clicking a file in stash view doesn't but opens the file version. I think this should be fixed so that stash view also shows compare view, add a context menu to allow opening the file version. - The list of parents shown in the stash commit viewer could indicate what's the content of each of them, instead of showing Parent: <commitId1> Parent: <commitId2> Parent: <commitId3> we could show: Previous version: <commitId1> Index: <commitId2> Untracked: <commitId3>
Created attachment 244071 [details] Inconsistent decorators in stash view compared to staging view
(In reply to Matthias Sohn from comment #4) > comments for https://git.eclipse.org/r/#/c/28037/2 > > nice improvement :-) Yes :). > Good idea to mimic staging view to display stash details. Though a few > things should be fixed to make the stash view more consistent with the > staging view: > - The git decorators in the stash commit viewer don't match the > corresponding decorators shown by staging view before creating the stash. I > think this should be fixed, see the attached screenshot Do we really want these to match? In the current version, it looks like the stash commit viewer uses the same decorations as the file diff table in the history view and in the normal commit viewer, which is a good thing. Would you want to change the display in the history view and commit viewer as well, or just add a special case for stash commits? > - The list of parents shown in the stash commit viewer could indicate what's > the content of each of them +1. Some other comments: - The Diff tab could show the combined diff for now (like git stash show -p) - I think showing author/committer date would be useful ("When did I stash these changes again?")
*** Bug 381701 has been marked as a duplicate of this bug. ***
With this in place, bug 420936 (stashes in toolbar) can be nicely implemented, marked this as dependency.
(In reply to Robin Stocker from comment #6) > (In reply to Matthias Sohn from comment #4) > > comments for https://git.eclipse.org/r/#/c/28037/2 > > > > nice improvement :-) > > Yes :). > > > Good idea to mimic staging view to display stash details. Though a few > > things should be fixed to make the stash view more consistent with the > > staging view: > > - The git decorators in the stash commit viewer don't match the > > corresponding decorators shown by staging view before creating the stash. I > > think this should be fixed, see the attached screenshot > > Do we really want these to match? In the current version, it looks like the > stash commit viewer uses the same decorations as the file diff table in the > history view and in the normal commit viewer, which is a good thing. > > Would you want to change the display in the history view and commit viewer > as well, or just add a special case for stash commits? you are right, I didn't consider that this would create inconsistencies with other views, so I withdraw my proposal to make the decorators match those shown in the staging view
Thanks for constructive feedback! I have already implemented some of your suggestions, but I am not yet ready to upload a new patch. C-Git doesn't include untracked files in the stash diff. I would suggest to include those nevertheless in the diff tab.
Please review the latest changeset. These changes are included: - commit parent labels named HEAD, Indexed and Untracked. - unstaged changes are sorted by path - double click on file compares with previous version - diff tab content - save/restore of the view state on application restart
merged as 30c5a5545c56d8b4cf93ccdfa76cb1b4756a2901
/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties line 1738 has a ' too much at the end: StashDropCommand_stashCommitNotFound=No stash commit found with id=''{0}'''
(In reply to Markus Keller from comment #13) > /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties line > 1738 has a ' too much at the end: > > StashDropCommand_stashCommitNotFound=No stash commit found with id=''{0}''' Thanks, fixed in eb1d6167c6f180eae819457d80e74e16063b6877.