-
Notifications
You must be signed in to change notification settings - Fork 612
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
Add a view for stashes #169
Comments
I like this idea and this would be a good first step to start supporting git's stash features. |
This patch adds a new "stash" view, bound to the 'y' key. This view displays the list of stashes. Pressing Enter on one of them displays the corresponding change in a split view. A new %(stash) variable is added for bindings and commands. Running 'tig stash' opens directly the stash view. A built-in command to pop the current stash is bound to 'P' in this view. Other bindings may be added in the ~/.tigrc file, for instance: bind stash D !?git stash drop %(stash) bind stash A !?git stash apply %(stash) bind status S !?git stash save --keep-index %(prompt) References: jonas#169, jonas#159 Signed-off-by: Vivien Didelot <[email protected]>
This patch adds a new "stash" view, bound to the 'y' key. This view displays the list of stashes. Pressing Enter on one of them displays the corresponding change in a split view. Running 'tig stash' opens directly the stash view. A new %(stash) variable is added for bindings and commands. A built-in command to pop the current stash is bound to 'P' in this view. Other bindings may be added in the ~/.tigrc file, for instance: bind stash D !?git stash drop %(stash) bind stash A !?git stash apply %(stash) bind status S !?git stash save --keep-index %(prompt) This is the v2 of PR jonas#173. References: jonas#169, jonas#159 Signed-off-by: Vivien Didelot <[email protected]>
This patch adds a new "stash" view, bound to the 'y' key. This view displays the list of stashes. Pressing Enter on one of them displays the corresponding change in a split view. Running 'tig stash' opens directly the stash view. A new %(stash) variable is added for bindings and commands. A built-in command to pop the current stash is bound to 'P' in this view. Other bindings may be added in the ~/.tigrc file, for instance: bind stash D !?git stash drop %(stash) bind stash A !?git stash apply %(stash) bind status S !?git stash save --keep-index %(prompt) References: jonas#169, jonas#159 [This is the v2 of PR jonas#173.] Signed-off-by: Vivien Didelot <[email protected]>
This patch adds a new "stash" view, bound to the 'y' key. This view displays the list of stashes. Pressing Enter on one of them displays the corresponding change in a split view. Running 'tig stash' opens directly the stash view. A new %(stash) variable is added for bindings and commands. A built-in command to pop the current stash is bound to 'P' in this view. Other bindings may be added in the ~/.tigrc file, for instance: bind stash D !?git stash drop %(stash) bind stash A !?git stash apply %(stash) bind status S !?git stash save --keep-index %(prompt) References: jonas#169, jonas#159 [This is the v2 of PR jonas#173.] Signed-off-by: Vivien Didelot <[email protected]>
Thanks @vivien :) |
Change the output to use "--pretty=raw", which is compatible with the main view. This simplifies the parsing of the 'stash{X}' ID by using the emitted 'Reflog' line and displays the stash date for free. The reference to the stash is stored as the commit->id for easy access when updating the status line (view->ref).
Looks great and clearer!
Thanks that's a cool improvement to this stash view! |
Thanks, this is just what I wanted! One minor nit: the diffstat section doesn't seem to be highlighted and doesn't support "enter to hop to file" as in a normal commit. Also might be nice to add a key drop the current stash, but since both delete and D are taken may not be worth it. |
Hi @RedBeard0531,
Yes, that's what I meant by the missing "jump-to-diff feature" in my previous comment.
As described in the commit message, there's currently just one built-in 'P' binding for pop, but others can easily be added. I also completed the wiki with those examples. See the 3 stash bindings in the wiki. |
Change the output to use "--pretty=raw", which is compatible with the main view. This simplifies the parsing of the 'stash{X}' ID by using the emitted 'Reflog' line and displays the stash date for free. The reference to the stash is stored as the commit->id for easy access when updating the status line (view->ref). Fixes #169
The two small improvements mentioned should be fixed. For combined diffs, jump-to-diff does not always work as expected, since a diffstat entry does not necessarily map to a 'diff --cc' entry. |
Ideally it could have a default view equivalent to "git stash list" and hitting enter would open a split that shows the equivalent of "git shash show -p --stat stash@{NUM}".
This is related to #159, but it is about creating stashes and this is about viewing them. If you think they are related enough to be a single issue, feel free to combine.
The text was updated successfully, but these errors were encountered: