[darcs-users] Fixing a repo with duplicate patches

Tobias Gruetzmacher tobias at portfolio16.de
Mon Dec 4 22:25:16 UTC 2006


Hi,

On Mon, Dec 04, 2006 at 07:47:27AM +0100, Michael Sperber wrote:
> I have a repository I synch over from CVS via tailor, where tailor
> generates a duplicate patch name.  How do I fix this?  Just changing
> the patch names with a text editor seems to generate a repo I
> subsequently cannot "get".  (I don't have the option of manually
> hacking the CVS repository.)

Why do you think the repository is "broken" and needs fixing? Since the
patch "name" (or "commit message" if you prefer the term other version
control systems use) is not something that uniquely identifies a patch,
so there is no problem with multiple patches having the same name. Darcs
uses a hash over the creation time, the author, the name and the patch
description to create a unique identifier for a patch. This has some
potential for collision, but I don't think you hit such a case. Look at
"darcs changes --xml-output" to see the hash darcs generated for your
patches. If you have a collision in these hashes, then there is a
problem, since they would reference the same file for different
patches...

> Generally, this worries me quite a bit: It appears tailor simply uses
> the darcs command line to generate the repository.  Why does darcs
> allow me to create a corrupt repo?  Is there any way to prevent this
> from happening in the first place?

You generally only get a collision if you have two patches by the same
author, created at exactly the same time and containing exactly the same
name and description. There's a pretty slim chance you get a collision
in all these parameters at the same time...

Hmm... I just tested this. Seems darcs is silently overwriting one patch
with another if they collide this way. This seems like a very serious
bug to me, even if that situation isn't very likely.

Another minor thing: The terminology seems to be a bit ambiguous
regarding "patch name" - First, this term is used for the short commit
message. But it is also used for the complete patch meta data, when
"darcs check" fails with "Error! Duplicate patch name:" and then shows
date, author, commit message and long description of the patch. I think
this needs to be split apart. I'm certainly a little bit unsure which
one the OP meant here, but I don't want to change my complete mail now
;)

Greetings, Tobi

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
Registered FLI4L-User #00000003
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20061204/23cc864e/attachment.pgp 


More information about the darcs-users mailing list