git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [offtopic?] xdelta patch format wrapper
@ 2008-02-13  1:53 Martin Langhoff
  2008-02-13  3:32 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Langhoff @ 2008-02-13  1:53 UTC (permalink / raw)
  To: git; +Cc: jmacd

This is somewhat offtopic but this list is the best-informed crowd on
diff/xdelta matters so here I am, abusing your attention...

I am working on an "incremental content" feature for Moodle - and my
plan is to serve pre-computed "patchfiles" based on the xdelta utility
to the client systems.

Now, I need to provide a wrapper that concats the deltas from the xdelta
utility with a more verbose header - akin to the header in git's unified
diff output. This is because the xdelta utility only handles one file
delta at a time - the file is a pure delta (prefaced with a SHA1 of the
file it applies to, IIRC).

(From xdelta I like that it's one-way-only, and compressed internally --
thus saving a lot of space on large changes. There are small statically
linked binaries for windows, osx and linux. I did consider using git's
own diffs, but it involves significantly more work, and portability to
Win32 is still green for the wide distribution this project is expecting.)

So my question is what is a good format for the header? My thinking sofar:

 - have a prefix to scan for, such as "xdelta" at the beginning of
   the file, or after a newline/whitespace

 - keep the <fromsha1> <tosha1> line

 - \0 delimited filenames

 - filenames as ambiguous bag'o'bytes or utf-8?
   (should we have another flamewar on this? ;-) )

 - keep file modes and perhaps support copy/move headers

 - keep a/ b/ prefixes?

 - last line in the header is length: <length-in-bytes>, followed by
   a newline and the xdelta itself

 - one or more newlines follow the end of the xdelta if there is another
   header coming

Something along the lines of

xdelta d065883..74cd8e5 100644
a/foo.zip\0
b/foo.zip\0
length 1024
<1024 bytes of xdelta data>

xdelta d065883..74cd8e5 100644
a/bar.zip\0
b/bar.zip\0
length 92312

<92312 bytes xdelta data>EOF

  ---

Would the above work as a reasonably solid patch header format? Is there
something else I should be using instead of rolling my own? If there
isn't a more suitable tool,  and I'm hoping to come up with something
unambiguous and reliable that is generally useful.

[ I have to confess, it came as a bit of a surprise that xdelta didn't
support this out of the box. Haven't seen any existing wrapper for it
that covers this either. ]

As a kludge I could tar both sides and xdelta across the tars, but it is
wasteful, and an xdelta-based diff/patch that can handle multiple files
does seem useful. And I don't know how stable the output of tar is (wrt
file ordering for example).

TIA for any feedback :-)


m
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-13 17:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13  1:53 [offtopic?] xdelta patch format wrapper Martin Langhoff
2008-02-13  3:32 ` Junio C Hamano
2008-02-13  3:46   ` Martin Langhoff
2008-02-13  3:56     ` Junio C Hamano
2008-02-13 11:33     ` Johannes Schindelin
2008-02-13 17:53       ` Martin Langhoff
2008-02-13  4:13   ` Martin Langhoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).