W3C home > Mailing lists > Public > w3c-dist-auth@w3.org > July to September 2006

PATCH delta: dsfantf1

From: <edgar@edgarschwarz.de>
Date: Sat, 26 Aug 2006 00:27:03 +0200 (MEST)
Message-Id: <200608252227.k7PMR3Mp025368@post.webmailer.de>
To: w3c-dist-auth@w3.org
Cc: edgar@edgarschwarz.de

Lisa asked for my delta format recently.
FWIW here the spec of my delta format.
This is from es.VCSBase.Mod. A WebDAV/DeltaV contribution package to the Native Oberon
system of Niklaus Wirth and Juerg Gutknecht of ETH Zuerich. 
Succeeeded by Bluebottle now (http://bluebottle.ethz.ch)
Please keep in mind that this is from the last millenium and wasn't meant to be 
scrutinized by "RFC professionals". It was written as a quick and dirty reminder
for me to remember the format of my delta files.

>From es.VCSBase.Mod:

$   1, Edgar.Schwarz@z.zgs.de, 31 Jan 99, 1:7:28
$ first version for new format
(** new delta file format
description
	(ci) = compressed integer in Oberon style
	(d) =  data as array of bytes
	tags = numbers coded as a byte
---------
DeltaFile =  # newest revision of file + deltas
	FormatName Flags Text 1{ Diff } .
FormatName = "dsfantf1" .
Flags = SET{31..1,MakroBit}.
Text = TextTag TextLen(ci) Text(d) .
Diff = # newer before older diffs
	DiffTag DiffLen(ci) OldTextLen(ci)
	Versiontag Version(ci)
	DateTag DateLen(ci) Date(d)
	AuthorTag AuthorLen(ci) Author(d)
	LogTextTag  LogTextLen(ci)  LogText(d)
	{ DeltaAddTag   AddLen(ci) AddData(d) 
	  | DeltaCopyTag CopyLen(ci) CopyOffset(ci) }
	[ AttachmentTag AttachmentLen(ci) Attachment(d) ] .
*)

So perhaps some remarks are useful:
- The email address given probably doesn't work anymore.
- (ci) is a number which uses as many bytes as necessary. 7 bits of a byte.
  The msb is used to show that another byte follows. Niklaus Wirth used such
  numbers in parts of his Native Oberon system.
- The new resource is created by:
  - Add: n bytes from delta.
  - Copy: n bytes from source. Referenced by an offset to a source file rider.
          Offset can be negative. So you can get some stretch repeatedly or move 
          parts of source around.
  - Attachment: add some miscellaneous data to a version. E.g. WebDAV properties.
          Not further specified yet.

That's all :-)

Some trivial extensions (For perhaps "dsfantf2") are
(Not checked for sanity. Just brainstorming):
- Use bit 7 of the tag byte to work with an additional source rider on the newly
  created resource for copy.
- Use bit 6 of the tag byte to specify absolute positioning instead of the moving
  rider offset.
- DeltaCallTag CallLen(ci) CallOffset(ci) could be used to define a sort of
  "functions" in the delta. "DeltaCallTag 0 offset" will skip a "function" definition.
- Use another target rider to patch the original resource for further copy/call
  tricks.
The "call" and targer rider stuff just came to my mind when I thought about possible
extensions of the format. Could give some tricky ways to "compress" data with patterns.

Now if anybody thinks that "dsfantf1" could be a simple mandatory delta format
for binary files with a PATCH I wouldn't mind. I would be surprised if you find
something similar enough to give IPR problems anywhere. But OTOH you never know.

Cheers, Edgar
Received on Friday, 25 August 2006 22:27:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:44:15 GMT