[darcs-users] add conflict avoidance idea... (need input)

Quag quaggy at gmail.com
Sun Sep 26 10:09:51 UTC 2004


Hi David,

How about using a hash of the file's contents instead of the current
datetime? This would mean that if the same file was added in two
different repos the files would still be considered the same.

There would still be a speical case of adding an empty file. When
adding an empty file, you could use the datetime instead of the hash.

Maybe I'm missing something and the hash would defeat the purpose of
this change. :-)

Jonathan.


On Sun, 26 Sep 2004 05:37:23 -0400, David Roundy
<droundy at abridgegame.org> wrote:
> I have an idea that would immediately make darcs more effective at
> resolving conflicts when files are added, but it carries a user interface
> cost, so I'd like to hear opinions on whether it would be a net
> improvement.
> 
> It is much easier for darcs to handle conflicts in renames than conflicts
> in creations.  The reason is that by definition if two files are renamed to
> the same file, they started out with different names, and this breaks
> symmetry, allowing darcs to decide how to rename one of them to deal with
> the conflict.
> 
> So the idea is that darcs add could be modified to first create every file
> with a date/time extension (e.g. ./foo-20040925233056), and then mv that
> file to the desired name (e.g. ./foo).  The result would be that unless two
> files were created at the same time with the same name, creation conflicts
> would turn into rename conflicts, and thus be better handled.  The catch is
> that instead of having two primitive patches when a file is added (add +
> hunk) we'd now have three, which could be a bit annoying, especially since
> add conflicts aren't really very common.
> 
> On the plus side, this wouldn't change darcs internally at all, so the
> fancy add creation could be an option.  To do any good, it would probably
> have to be enabled by default.  Anyone who enables this option probably
> wouldn't be having problems with add conflicts anyways.
> 
> There are a couple of other issues.  It may cause problems in terms of
> introducing an extra limitation on filename size for platforms or
> filesystems with limited filename lengths.  A more serious issue is that
> the rename conflict code hasn't seen much testing and could be buggy.  It's
> not simple code, and it's very old code (which doesn't make it worse, but
> means I wrote it when I was newer to darcs... that is, when darcs was
> newer).
> 
> Thoughts, opinions and suggestions are welcome.
> --
> David Roundy
> http://www.abridgegame.org
> 
> _______________________________________________
> darcs-users mailing list
> darcs-users at abridgegame.org
> http://www.abridgegame.org/mailman/listinfo/darcs-users
>




More information about the darcs-users mailing list