Revert option for git add --patch
- From
Nathan Broadbent <nathan.f77@gmail.com>
- Date
- Nov 7, 2012, 23:54 UTC
- Message-ID
- <CAPXHQbN0x-o_4rQO-Lq_gDTqs=beBE5XrrzJ1Th+7G2Lq7Dh_Q@mail.gmail.com>
- In-Reply-To
- <CAPXHQbOxNG0XN80rH6mM6iSVtCtU26Yio_XQ=5ofBHBpZN3VyQ@mail.gmail.com>
Hi,
I would like to propose a revert option for 'git add --patch', that reverts the hunk. I often use `git add -p` to skip whitespace changes when preparing a patch, and a 'revert' option would save me from running 'git checkout <file>' after I've staged the desired changes.
I would propose adding r and R options for the 'Stage this hunk' menu, with the following actions:
r: Revert this hunk R: Revert this hunk and all other remaining hunks
e.g. Stage this hunk [y/n/a/d/K/j/J/e/r/R?]?
Please let me know if you think this is a good idea.
Best, Nathan