[darcs-users] symbolic links

Keith Browne tuxedo at funkrehab.com
Wed Dec 19 12:51:43 UTC 2007


Albert Reiner wrote:
> On Mon, Dec 17, 2007 at 02:54:54PM -0500, David Roundy wrote:
>> The semantics you describe could certainly be implemented, but I'd by
>> highly suspicious of supporting symlinks to directories.  It's asking for
>> crazy things to happen, since it'd mean that darcs would then be willing to
>> write outside of a repository.
> 
> In that case, why don't you also prohibit hard links?

On a Unix filesystem, every file is a hard link.  You could prohibit 
files which are synonyms for files which have hard links which aren't 
under the current repository tree, but that'd be a difficult piece of 
bookkeeping.

>   $ touch bar
>   $ mkdir foo
>   $ cd foo
>   $ darcs ini
>   $ touch a
>   $ ln a b
>   $ darcs add a
>   $ ln ../bar c
>   $ darcs add c
>   $ darcs rec -a
>   What is the patch name? ac
>   Do you want to add a long comment? [yn]n
>   Finished recording patch 'ac'
> 
> If a patch modifying c is pulled into this repo, I would expect ../bar
> to change, too.

I wouldn't expect that, and in fact when I just tried this with Darcs, 
it pulled the patch, overwrote c, and didn't alter the contents of bar. 
    I infer that Darcs isn't opening the file indexed by the inode that 
c points to, then overwriting its contents--it's clobbering c, opening a 
new file named c, and putting the post-patch contents there.  That's 
what I'd expect.

Keith Browne
tuxedo at funkrehab.com


More information about the darcs-users mailing list