[Haskell-cafe] ANNOUNCE: ipatch, the interactive patch editor

Joachim Breitner mail at joachim-breitner.de
Mon Aug 23 16:32:36 EDT 2010


Am Montag, den 23.08.2010, 15:10 -0500 schrieb Antoine Latter:
> On Tue, Aug 3, 2010 at 3:52 PM, Joachim Breitner
> <mail at joachim-breitner.de> wrote:
> > Dear Haskell and Darcs community,
> >
> > I have written a tool to interactively edit patches, which under the
> > hood uses the Darcs API. A more catchy introduction, including a
> > screencast, can be found on
> > https://www.joachim-breitner.de/blog/archives/425-ipatch,-the-interactive-patch-editor.html
> > which ends (and this is where you come in) with
> > „So this is an invitation to join me and make ipatch a great tool. This
> > invitation goes especially to the Darcs developers: Please have a look
> > how the code uses the Darcs API and help to improve the collaboration
> > here. I think we can use the darcs-users mailing list until there is
> > need for a dedicated mailing list.“
> >
> > The code is on http://darcs.nomeata.de/ipatch/.
> Do you have any documentation on what this utility does? I don't quite
> understand what I would use it for. What limitations does it have on
> the patch formats I can use with it?

The help output of the commands might be enlighting:


$ ipatch 
ipatch version 0.1
Usage: ipatch COMMAND ...

  help           Display help about ipatch and ipatch commands.

Changing files
  apply          Apply a diff file interactively.

Changing patches
  split          Split a diff file interactively.

Use 'ipatch COMMAND --help' for help on a single command.
Use 'ipatch --version' to see the ipatch version number.


$ ipatch split --help
Usage: darcs split [OPTION]... <PATCHFILE>
Split a diff file interactively.

      --disable             disable this command
  -h  --help                shows brief description of command and its arguments

Advanced options:

The `ipatch split file.patch' lets the user select different parts (hunks) of the
given patch file. After making a choice for each hunk, the user has to provide a
file name where the selected changes are stored. This procedure is repeated until
each change in the original file has been selected for one output file.

No files are modified by this command. The output patch files are all written at the
of the process.


$ ./dist/build/ipatch/ipatch apply --help
Usage: darcs apply [OPTION]... <PATCHFILE>
Apply a diff file interactively.

      --disable             disable this command
  -h  --help                shows brief description of command and its arguments

Advanced options:

The `ipatch apply file.patch' command works similar to a `patch file.patch' command.
It will, however, prompt the user about each part of the patch, whether it should
be applied or not. Using the integrated hunk editor, the user has full control over
the chosen changes.

No files are touched until the end, when the user is asked for a final confirmation.


I’m not particular sure if apply is helpful. Maybe mostly to review a
patch hunk-for-hunk before applying and doing minor fix-ups (using the
hunk editor) directly there.

The main feature is the split command. My motivation comes from
maintaining Debian package where dpkg-buildpackage generates one large
patch from your changes to the upstream sources which I might want to
store separately, maybe because it contains independent changes.

For this, I plan some integration into quilt, e.g. add a mode that
splits the next patch in the series and puts the generated patches into
the series file.

I don’t think it is of much use if you are already using a VCS to
maintain your changes. Although having a "split" command in "git rebase
-i" that uses ipatch to split a change could be nice.

The limitations on the patch files are that they have to be parseable by
"diffstat" (to obtain the list of changed files) and that they need to
apply cleanly to the current directory using "patch". Unclean patches,
already applied patches or patches that require different "-p" options
are not supported yet, but will eventually.


Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100823/79725f4e/attachment.bin

More information about the Haskell-Cafe mailing list