[darcs-users] symbolic links

Albert Reiner areiner at tph.tuwien.ac.at
Tue Dec 18 19:49:39 UTC 2007


First of all, thanks to you and Ketil Malde for taking the time to
look into this.

On Mon, Dec 17, 2007 at 02:54:54PM -0500, David Roundy wrote:
> > What I want is for darcs to ignore that those are symbolic links, and
> > to treat the file contents as if they were hard links or copies, at
> > least as an optional behavior.  This also seems to be the behavior of
> > least surprise, and it is the way things used to be.
> 
> What you describe involves deleting the symlinks.  And this behavior has
> not changed in a *long* time.  Note that this behavior isn't particularly
> unusual.  You'll get the same effect if you try to edit a symlink using
> emacs, for instance.

Now I am completely confused: With emacs I never edit the symlink, but
the pointed-to file.  And in that case the symlink does not change and
is not deleted; the symlink's target changes.

Also, it seems that I was not successful in conveying that I do not
want a symlink to be part of the repo, but that I want the content of
the symlink's target to be in the repo.  Now that I think about this a
bit more, the semantics I would expect would be to

- treat the symlink as if it were a copy of its target for reading
  operations (like `whatsnew`), and to

- replace the symlink with a copy for writing operations (like
  `pull`).

> Why are you including auto-generated symlinks in your repository?

See my previous reply to Ketil Malde's mail.

> Note that the behavior you are asking is quite different from what will
> happen when darcs properly supports symlinks.

I feared so much.

> 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?

  $ 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.

As for my original question, I take the answer is that I have not
overlooked an option in current darcs that would get me the desired
semantics.

Thanks again,

Albert.


More information about the darcs-users mailing list