Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

patch-interactively

Dear lazyweb,

I want a command -- "patch-interactively". It takes a diff as input and lets you interactively walk through it as it tries to apply to your tree -- sorta like how darcs (or git add -p) does interactive cherry-picking of diff chunks, or sorta like how merge tools work but without applying any of the diff without your explicit action.

Here's my common scenario: I'm working on a patch and I discover I've unintentionally changed the whitespace on a part I don't care about. I don't want to throw away all my work but I want a minimal diff. I find myself manually reconstructing the whitespace -- lame. (I believe but it's been too long for me to say definitively that darcs provides an interactive revert command just for this kind of scenario.) In my imagined world I could run "git diff | patch-interactively" to pick and revert just what I wanted.

Another common scenario: you have a patch where half of it is good, but the other half isn't. I find myself manually editing the patch and deleting the chunks I don't like -- also lame, and sometimes I end up corrupting the patch. Instead, I could "patch-interactively < patch".

In all cases I want something fancier than the darcs interface; good merge tools (side-by-side, coloring) are way too useful.

As before, I have the suspicion this has already been built -- where? (Feels like the kind of thing that Emacs would do...)
Subscribe

  • salt

    An old friend of mine classified people as salt or nuts. I realized recently that I think of blogs in the same way: some people just point at other…

  • my meme-propagation technique is unstoppable

    A few weeks ago, I guy I know from work* pointed me at an rather interesting but rather nerdy paper from four years ago. I then dutify relayed to…

  • cute sideload

    I like the pictures on Cute Overload, but the commentary makes me wanna stab. The solution: Cute Sideload, Cute Overload without the text. Update:…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 7 comments