[darcs-users] patch file naming

Kevin Smith yarcs at qualitycode.com
Wed Mar 17 16:09:27 UTC 2004

Ganesh Sittampalam wrote:
> I just discovered that the SHA1 element of a patch file name is generated
> purely from the patch name, author, date, long comment (if any) +
> inversion status (whether this is a reversed patch or not, I guess). 

> a little worrying. Why not hash the entire patch contents, rather than
> just the header information? 

With darcs, the actual specific contents of a patch will often change as 
that patch moves from repo to repo. A patch file contains just one 
possible representation of the underlying conceptual patch. So it is 
impossible to use the hash of the current file contents as a permanent 

It *might* be possible to hash a canonical representation of the 
conceptual patch that is implemented by the file. But canonical 
representations have not yet been determined, and I haven't thought 
about it long enough to even know if there could even be a such thing as 
a canonical patch format in darcs.

Your problem case does concern me a bit, but doesn't put me in to a 
panic. darcs should probably refuse to record two patches within the 
same timestame frame (1 second, I believe). That still wouldn't prevent 
all problems, but probably eliminate any accidental cases.

It also seems that at some point in the future, darcs could have the 
ability during a pull or push-application to optionally detect whether a 
duplicate patch name actually contains the same patch. If the user 
specified the patch, it would be easy and fast. If darcs had to evaluate 
every incoming patch, it seems like it would be brutally slow.


More information about the darcs-users mailing list