Implement 'git stash save --patch'
commitdda1f2a5c3aca5072aada32eef159067ba16f0e9
authorThomas Rast <trast@student.ethz.ch>
Thu, 13 Aug 2009 12:29:44 +0000 (13 14:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Aug 2009 22:19:31 +0000 (15 15:19 -0700)
tree02fc359424824fd005e183044e2bc2a9d14df930
parent4f353658b9c15e9188530fac5ae79d0aa1538e85
Implement 'git stash save --patch'

This adds a hunk-based mode to git-stash.  You can select hunks from
the difference between HEAD and worktree, and git-stash will build a
stash that reflects these changes.  The index state of the stash is
the same as your current index, and we also let --patch imply
--keep-index.

Note that because the selected hunks are rolled back from the worktree
but not the index, the resulting state may appear somewhat confusing
if you had also staged these changes.  This is not entirely
satisfactory, but due to the way stashes are applied, other solutions
would require a change to the stash format.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-stash.txt
git-add--interactive.perl
git-stash.sh
t/t3904-stash-patch.sh [new file with mode: 0755]