Re: [RFC PATCH v2 3/3] Implement unstage --patch and discard --patch
- From
Matthias Kestenholz <mk@feinheit.ch>
- Date
- Jul 24, 2009, 16:40 UTC
- Message-ID
- <1f6632e50907240940j6174a689i4390c245f0771fcb@mail.gmail.com>
- In-Reply-To
- <9cad6176fe941bd56bad7fed49cc55a96a7040ae.1248452530.git.trast@student.ethz.ch>
On Fri, Jul 24, 2009 at 6:24 PM, Thomas Rast<trast@student.ethz.ch> wrote:
Show 16 quoted lines
> This implements a new optional argument --patch=<mode> in the > git-add--interactive helper. The modes are: > > 'stage' (default, as before): offer hunks from 'git diff' and stage > the ones selected by the user. > > 'unstage': offer hunks from 'git diff --cached', and unstage the ones > selected. > > 'discard': offer hunks from 'git diff', and discard (i.e., undo the > edit in the working tree) the ones selected. > > With this in hand, we can then easily add a --patch option to the > git-unstage and git-discard scripts that run git-add--interactive in > the corresponding modes. >
While I do not really think even more git commands are so helpful, I like the proposed command names, and I really like that it would be possible to remove single hunks from the index. I have come to rely very much on git add -p to make self-contained and clear commits and think it would be a great feature if I could use this the other way round too.
Thanks, Matthias