threads / discuss / 32037

Revert option for git add --patch

Subject: Revert option for git add --patch

## tl;dr

3 messages between Nov 7, 2012 and Nov 8, 2012.

replies: 2people: 3as markdown or json

Nathan Broadbent· Nov 7, 2012, 23:54 UTC · lore
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

Simon Rozet· Nov 8, 2012, 01:00 UTC · re: Nathan Broadbent · lore

Re: Revert option for git add --patch

help
On Wed, Nov 7, 2012 at 3:54 PM, Nathan Broadbent <nathan.f77@gmail.com> wrote:
Show 25 quoted lines
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Kiedrowicz· Nov 8, 2012, 08:46 UTC · re: Nathan Broadbent · lore

Re: Revert option for git add --patch

Nathan Broadbent <nathan.f77 <at> gmail.com> writes:
> 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.
Doesn't `git checkout -p` do what you describe?

Kind regards, Michal Kiedrowicz

← back to recent threads