Magit version
Magit 20160421.459, Git 2.8.2, Emacs 24.5.1, gnu/linux
Currently when I have Staged and Unstaged changes, it would be nice to stash the Unstaged changes. At the moment when I try to stash only the Unstaged changes, it stashes everything (Staged changes included). My use case was I staged my changes and left all Logger calls Unstaged. It'd be nice to not have to commit first before stashing.
It is difficult to only stash the unstaged changes because these changes might not apply to HEAD but only to HEAD plus the staged changes. That would be the case if you edited some lines and staged those changes and then further edited some of these same lines.
So there is no "stash only unstaged changes" command. The closest available command is "stash both staged and unstaged changes, but keep the staged changes", z x.
However a stash actually consists of several commits, which makes it possible to later attempt to apply only the staged changes. To do so move point to a stash and press RET to show the stash in a separate buffer. That buffer actually shows the changes of one to three commits, and you can apply one of these commits by moving to its heading, here "Unstaged", and then pressing A.
I'm confused -- isn't z w (magit-stash-worktree) exactly what is being asked for? That's certainly how I've been using it :) But maybe it's not actually doing exactly what I thought it was doing.
Damn I've got to look at the docs closer, that's what I wanted @phil-s . I was talking with someone else about this but on the git side and thought this wasn't a feature for some reason, thanks
Most helpful comment
I'm confused -- isn't z w (
magit-stash-worktree) exactly what is being asked for? That's certainly how I've been using it :) But maybe it's not actually doing exactly what I thought it was doing.