[darcs-users] darcs patch: Add Patch-salt as ignored prefix

zooko zooko at zooko.com
Wed Oct 8 13:25:49 UTC 2008


On Oct 8, 2008, at 7:14 AM, Eric Kow wrote:

> On Wed, Oct 08, 2008 at 07:03:49 -0600, zooko wrote:
>> There is a way to make this true: define an unambiguous encoding.   
>> For
>> example: make it so that darcs always appends the following to the  
>> end of
>> the patch comment: "Ignore-this-count-of-entries-to-ignore: 1".
>
> That's an interesting proposal, Zooko, but tricky to implement
> (especially with darcs being distributed and all), more so right
> up to the point of a release.

Hm, is it that tricky?  There is a very simple part of it that we  
could do for 2.1.0 since we you know that the count of entries to  
ignore in darcs 2.1.0 is always exactly 2 (the patch salt and the  
count of entries to ignore).

The implementation is simply to append the following string literal  
to each patch comment: "Ignore-this-count-of-entries-to-ignore: 2",  
and to hide any such line when displaying.

The reason to do it is because then future versions of darcs can be  
more precise and safe about knowing what to ignore in a patch  
comment, compared to if we do it the way currently proposed.  If we  
do it the way currently proposed, then future versions of darcs will  
probably have to be a little more imprecise in hiding lines.

If this still seems like too big of a change (in terms of its effect  
on future darcs's, rather than in terms of the source code required  
to implement it), then at least let us try to be very limited in what  
hidden fields darcs-2.1.0 will write into patch comments and what  
things darcs-2.1.0 will hide from patch comments.  For example, let  
us require that the "Ignore-this-patch-salt: BLAHBLAHBLAH" field is  
always the last line of the patch comment, and that it gets hidden  
only if it is the last line and only if BLAHBLAHBLAH matches the  
pattern of a a hex encoded random string of the right length.

The more constrained darcs 2.1.0 is in what it will do with regard to  
adding stuff on write and with regard to hiding stuff on display the  
more freedom future versions of darcs will have to do this better.

Regards,

Zooko
---
http://allmydata.org -- Tahoe, the Least-Authority Filesystem
http://allmydata.com -- back up all your files for $5/month


More information about the darcs-users mailing list