[darcs-users] File name too long

David Roundy droundy at jdj5.mit.edu
Fri Oct 10 12:33:35 UTC 2003


On Wed, Oct 08, 2003 at 06:33:20AM -0700, Zack Brown wrote:
> > Argh, yes.  I've been wishing for quite some time that I had decided to use
> > a simple hash for the patch file names.  For the problem you mention, there
> > is a simple fix, which is to have the CGI cache use a hash rather than the
> > URL.  I've implemented this fix, which is right now being "tested" and
> > should soon make it to the repository.
> 
> Why not change darcs to use the simple hash for patch file names, and offer
> a script to convert existing darcs repos to the new format? Now's the time
> to make such a change, while darcs is still young. (I know this has come up
> before, but now you say you wish for it yourself).

Well, part of the reason is that if it ain't broke, don't fix it.  Also,
with a hash there is a (very very small) possibility that two patches could
end up with the same hash, and that could lead to Bad Things.  With the
current scheme, it is also possible to create two different patches with
the same filename, but you can guarantee that this won't happen by waiting
a second between recording patches and by not using the same author name as
anyone else (who might happen to record a patch at the same time).  With a
hash there is no way to guarantee that you won't create a conflicting
patch.

One thing I've been thinking of is that I could use a hash with the author
and data appended.  That would mean that you *could* have a guarantee of no
conflicting patches, but would also uglify the resulting filenames just a
tad, and might make you wonder why we would bother changing at all.  On the
other hand, at least the variation in filename length would be restricted
to the date (which doesn't vary much) and the author.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list