[darcs-users] darcs patch: resolve issue1350: reliable patch transport

Gabriel Kerneis kerneis at pps.jussieu.fr
Sun Dec 19 22:08:27 UTC 2010

[cc: darcs-users for UI feedback]


I spent a few hours trying to solve issue1350 (more reliable transport
for patches).

The main issue with current "darcs send" format is that patches are sent
as "text/x-darcs-patch", but MTA/MUA might have trouble decoding them
because no charset is specified (which defaults to us-ascii, RFC 2046).
Note that it is impossible to find a proper charset since different
files touched by a single bundle might use different encodings.

This patch solves the issue by attaching bundles as "application/
x-darcs-patch".  To keep patches easy to review, it keeps a (stripped-
down) copy of the patch as text/x-darcs-patch.  Of course, if the patch
contains non-ascii characters, they will be rendered randomly, but it is
not an issue anymore since the full patch will be preserved and used by
darcs apply.

This patch is backward-compatible with older darcs releases.  For
instance, I used it to send this email: you can apply it directly
(against screened) with any darcs 2.x release (please try and let me
know if it fails).

Issue 1350 suggests that we compress the attached bundle.  I did not
follow this path because it would break backward-compatibility.  Ian
told me that I could use _darcs/format and add a "send-gzip-format" but
I have no idea how to do that in practice, and I think it is far more
important to ensure reliable transport, even towards older repositories.

[ Note that issue 1427 (resolved in 2.5) allows you to apply gzipped
  bundles, but it does not accept gzipped inside a MIME section (only a
  fully-gzipped input). ]

Please tell me if you like this new format (just look at this email!)
and how it could be improved to make it into the next darcs release.

Best regards,

1 patch for repository http://darcs.net/screened:

Sun Dec 19 22:42:19 CET 2010  Gabriel Kerneis <kerneis at pps.jussieu.fr>
  * resolve issue1350: reliable patch transport
  Note that this patch does not compress attached patches, for the sake
  of backward-compatibility.  But it does resolve the points of issue1350:
  hide context when reviewing a patch and ensure a reliable transport with
  application/x-darcs-patch instead of text/x-darcs-patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 2296 bytes
Desc: Patch preview
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101219/2e014570/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/x-darcs-patch
Size: 101209 bytes
Desc: A darcs patch for your repository!
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101219/2e014570/attachment-0003.bin>

More information about the darcs-users mailing list