[darcs-users] Patches are immutable

Zooko Wilcox-O'Hearn zooko at zooko.com
Tue Oct 26 11:41:30 UTC 2004


On 2004, Oct 26, at 08:17, David Roundy wrote:

>> It occurs to me that if I use darcs programmatically from another 
>> tool,
>> for example the tailor.py script that I currently use, then I'm 
>> playing
>> Russian Roulette with darcs's unsafe method of generating unique patch
>> ids.
>
> Well, that's what the time is there for.  If it's something you're
> concerned about, just make sure a second passes between each patch you
> record.  (or change the patch name)

But in practice I sometimes run tailor.py in one window and then run 
other darcs commands or even another tailor.py in another window.

Maybe the darcs manual should have a prominent warning that one mustn't 
run multiple darcs record commands at the same time, even if they are 
on different repos?  Maybe darcs should acquire a lock in ~/.darcs 
before snapping a timestamp?

The timestamp method of attempting to make patch ids unique is going to 
bite someone someday.  What will happen if two completely different 
patches have identical patch ids?


>> Is it too late to change patch ids to be 128-bit random numbers?
>
> Yes.

It's a shame.  Contemplating this issue gives me a queasy feeling that 
the tool I'm using on my source code is a sloppy tool which doesn't 
bother to guarantee important invariants like unique identifiers.


> Rerecord does create a new patch with a new name (different time).

Sorry for the mistake.  What I meant to say was that rerecord could be 
implemented by adding an inverse patch followed the new patch, rather 
than by removing the old patch followed by the new patch.  This has 
nothing to do with the unique names issue -- that was my mistake.


Regards,

Zooko





More information about the darcs-users mailing list