Re: RFE: Discard hunks during `git add -p`

2016-11-02 Thread Jeff King
On Wed, Nov 02, 2016 at 06:11:14PM -0400, Jeff King wrote: > > Being able to discard hunks (reset working copy to index contents) > > during add-p would alleviate the (quite broad) hard reset. > > As Konstantin pointed out, you can already discard interactively with > "git checkout -p". It

Re: RFE: Discard hunks during `git add -p`

2016-11-02 Thread Jeff King
On Wed, Nov 02, 2016 at 02:46:04PM +0100, Jan Engelhardt wrote: > Current version: 2.10.2 > Example workflow: > > * I would do a global substitution across a source tree, e.g. `perl -i > -pe 's{OLD_FOO\(x\)}{NEW_BAR(x, 0)}' *.c` > * Using `git add -p`, I would verify each of the substitutions

Re: RFE: Discard hunks during `git add -p`

2016-11-02 Thread Konstantin Khomoutov
On Wed, 2 Nov 2016 14:46:04 +0100 (CET) Jan Engelhardt wrote: > Current version: 2.10.2 > Example workflow: > > * I would do a global substitution across a source tree, e.g. `perl > -i -pe 's{OLD_FOO\(x\)}{NEW_BAR(x, 0)}' *.c` > * Using `git add -p`, I would verify each of the

RFE: Discard hunks during `git add -p`

2016-11-02 Thread Jan Engelhardt
Current version: 2.10.2 Example workflow: * I would do a global substitution across a source tree, e.g. `perl -i -pe 's{OLD_FOO\(x\)}{NEW_BAR(x, 0)}' *.c` * Using `git add -p`, I would verify each of the substitutions that they make sense in their respective locations, and, based on that,