sourcegit-scm/sourcegit

[Feature request] Add export of stashes as patch

Closed this issue · 4 comments

In stash-view there is a context menu that allows the user to Apply, Pop and Drop a stash.
It would be great to have an extra export option in that context menu. A popup should appear that asks for a file name that could be generated using the caption of that stash. A default location (e.g. checkout dir root) would be fine.

The command to export an existing stash is:

git stash show "stash@{0}" -p > changes.patch

Applying and re-stashing that patch is already available (just apply and create a new stash).

Done. You can download the latest CI build from Github Action.

Tested - works.

Nice feature would be to copy the name of the stash to clipboard to create the filename easily.

Using the Stash message as the default file name can have some problems, such as including illegal characters for path.

Yeah - right. (one could replace them using underscore)

I got your point. All solutions might fell a bit ugly.

Thx for implementing the export feature.