[darcs-devel] [issue1470] Allow to amend-record patch by removing some hunks

Nicolas Pouillard nicolas.pouillard at gmail.com
Wed May 27 08:21:08 UTC 2009


Excerpts from Dmitry Astapov's message of Tue May 26 12:21:40 UTC 2009:
> 
> New submission from Dmitry Astapov <dastapov at gmail.com>:
> 
> Hi,
> 
> Suppose that I have working copy with 1000 hunks in "darcs diff". I do
> "darcs record" and record 500 of them. Then I realize that I forgot to add
> another 5 hunks. I do "darcs amend" and include them as well.
> 
> Then I realize that I included 2 hunks by mistake. Now I'm out of luck,
> because there is no easy way to remove those two hunks from the patch. I can
> do "darcs unrecord", but it'll mean that I would have to select all those
> ~500 hunks once again.
> 
> Now, it would be nice to have "amend-record --remove" or something like
> that, which would allow me to select hunks from already recorded patch and
> make them active again.

You can workaround this shortcoming, that's a bit manual though...

You have to manually undo the hunks you want to remove. You can do so by
looking at the recorded change using 'darcs change --last 1 -p' and
copy/pasting the removed part to make the current version again. Then
doing a 'darcs amend-record' would show you hunks to add that should
be coalesced with the original one leading to no change at all in the
resulting patch (sometimes coalescing is not smart enough though).

-- 
Nicolas Pouillard


More information about the darcs-devel mailing list