On Tue, Nov 3, 2015 at 1:33 AM, Stephan Beal <sgb...@googlemail.com> wrote:

>
> On Mon, Nov 2, 2015 at 6:32 PM, Eric Rubin-Smith <eas....@gmail.com>
> wrote:
>
>> the user when trying to move a tarball from one OS to another.  In other
>> words, I believe that you perceive a dichotomy that is false (between (a)
>> not implementing symlinks at all and (b) implementing them while having
>> fossil perfectly and automatically solve all complications that may arise).
>>
>
> That sounds like a fair summary of my feelings on SCM support for
> symlinks, but i'd argue that if a system (SCM) cannot do (b) for the vast
> majority of use cases, then it probably shouldn't be implemented at all.
> Why not? Because it's the _displeased_ users who complain the loudest when
> something doesn't work how they want/expect it do, and that percentage of
> users is relatively high in the case of symlinks.
>
> A user who only ever uses fossil on unix should get unix symlink semantics
>> on unix, without quirks or surprises.  Surely you and DRH would agree with
>> that?
>>
>
> i can't speak for Richard, but if i had my way, fossil wouldn't support
> symlinks at all. They are inherently platform-dependent and, IMHO, belong
> in the build process, not the SCM. They are a big can of worms, as we can
> see by large amount of emails on the topic. To be clear: i use symlinks all
> over the place on my systems, i just refuse to use them in an SCM. Call me
> old fashioned.
>
>

:-) Fossil creates a problem by not supporting symlinks properly, and you
use the volume of complaints about the problem to support your claim that
the problem was inevitable.

Not implementing them at all, or implementing them poorly as Fossil has, is
what maximizes complaints -- hence the large amount of emails.  I wouldn't
dream of complaining about Git's support of symlinks, because it just works.

I just don't think this is a deep conundrum.  Lots of cross-platform
programs have to deal with symlinks, have done so, and the universe has not
collapsed from the logical implications.  If the link is broken just fix
it.  If the OS doesn't support symlinks then those see some reasonable
degradation, possibly coupled with warnings.  And those of us who use OSes
with symlink support don't have to suffer needlessly because of the poor
decision-making of other OS authors.


>
> Absolute paths in an SCM are "just plain wrong" (IMO). Even the innocuous
> link to /etc might be wrong in certain build environments (and won't work
> on Windows). Why should fossil assist in doing the wrong thing?
>

Here you give away the game by saying "IMO".  Whether it's wrong is a
question of policy, as you seem to admit.  And such examples have clearly
led you down a path of arguing that your policy is the right one -- to the
detriment of the tool.

Your particular example is actually great for my case, because it applies
with equal force to the case of filesystems.  A filesystem can be mounted
at any mount point, so an absolute symlink to '/etc' that works fine when
the FS is mounted at '/' will not be correct when the FS is mounted at
'/foo/bar'.  So absolute symlinks are also wrong in this case.  Why should
Linux assist in doing the wrong thing?

Well, because it's a really useful tool.  Sometimes the tool can be misused
or uncover some corner cases or whatever, but overall it's really useful.
So let's support it and let the user deal with those weird cases if they
come up (or just wallow in the pure bliss of a useful tool if the cases
don't come up).


> Stated yet another way: we don't expect the SCM to solve all problems that
>> users create.
>>
>
> But if it sets out to solve them, then it should solve them, not provide a
> half-solution to philosophically unsolvable problems. (IMO.)
>

Your argument is analogous to an argument that compilers can't detect and
correct all program bugs, so we may as well not write compilers at all.
This is an enormous problem, you could argue, because almost all programs
have bugs, and so the compiler is doomed to fail almost every time!

Of course you wouldn't say that, because you would rightly notice that this
is a false dichotomy: it's not the compiler's job to detect all program
bugs.

We can support symlinks without setting out to solve all problems that
arise.  It's not a half-solution -- it's a full solution to a narrower
(and, in fact, pretty simple) problem.


>
> For context, my particular use case: we need the openssl source tree in
>> our project, and that tree contains internal symlinks.  Again, people have
>> to jump through silly hoops to get new repos set up properly, because
>> fossil breaks those symlinks by populating new repos with flat text files
>> (and this goes undiscovered til the openssl build fails in mysterious
>> ways).
>>
>
> To the best of my knowledge, if symlinks are enabled in the fossil config,
> it will DTRT with them (to the best of its ability). i haven't tried it,
> but that's my understanding of the feature. IIRC symlinks are on by default
> on Unix systems and off everywhere else (that info might be outdated,
> though).
>

It defaults to off, and it should go without saying that a "do the right
thing" setting should default to on.  And the setting itself continues to
be buggy in the case of opening a repository (the setting is not honored,
so symlinks are initially populated as flat text files until you go `rm`
them and then `fossil update`).  See the transcript below.  This leads to
surprised users who now have a bad first impression of Fossil.  I tried to
fix this a year or so ago, but I noted that my patch introduced some bug or
other :-/ so I don't think the devs ever committed it -- and I had to turn
my attention elsewhere.

Transcript:

[little:test] $ fossil version
This is fossil version 1.34 [62dcb00e68] 2015-11-02 17:35:44 UTC
[little:test] $ uname -a
Linux little 3.13.0-66-generic #108-Ubuntu SMP Wed Oct 7 15:20:27 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
[little:test] $ fossil new foo.db
project-id: ad2bb86c667697c5902de1484c929c4abf0c7f5b
server-id:  87da518b0ec4caba7c77bfde1ab219e5e45edca3
admin-user: eas (initial password is "9764fe")
[little:test] $ mkdir sandbox
[little:test] $ cd sandbox/
[little:sandbox] $ fossil set allow-symlinks
allow-symlinks
[little:sandbox] $ fossil set allow-symlinks on
[little:sandbox] $ fossil set allow-symlinks
allow-symlinks       (global) on
[little:sandbox] $ fossil open ../foo.db
project-name: <unnamed>
repository:   /home/eas/tmp/test/sandbox/../foo.db
local-root:   /home/eas/tmp/test/sandbox/
config-db:    /home/eas/.fossil
project-code: ad2bb86c667697c5902de1484c929c4abf0c7f5b
checkout:     56a0d3fbaf7ed2ba9ab0af91c7aa01a48d61c4fd 2015-11-03 15:13:05
UTC
tags:         trunk
comment:      initial empty check-in (user: eas)
check-ins:    1
[little:sandbox] $ fossil set allow-symlinks
allow-symlinks       (global) on
[little:sandbox] $ echo 1234 > foo
[little:sandbox] $ ln -s foo foo.lnk
[little:sandbox] $ ls -l
total 16
-rw-r--r-- 1 eas eas 5 Nov  3 10:13 foo
lrwxrwxrwx 1 eas eas 3 Nov  3 10:13 foo.lnk -> foo
[little:sandbox] $ fossil add foo foo.lnk
ADDED  foo
ADDED  foo.lnk
[little:sandbox] $ fossil commit -m "Add file and symlink."
New_Version: 6171ab90d514f1aa2d2d628680c6eba90dee134c
[little:sandbox] $ cd ..
[little:test] $ rm -rf sandbox/   ;# pretend to be a new user opening the
repo
[little:test] $ mkdir sandbox
[little:test] $ cd sandbox/
[little:sandbox] $ fossil open ../foo.db
foo
foo.lnk
project-name: <unnamed>
repository:   /home/eas/tmp/test/sandbox/../foo.db
local-root:   /home/eas/tmp/test/sandbox/
config-db:    /home/eas/.fossil
project-code: ad2bb86c667697c5902de1484c929c4abf0c7f5b
checkout:     6171ab90d514f1aa2d2d628680c6eba90dee134c 2015-11-03 15:13:56
UTC
parent:       56a0d3fbaf7ed2ba9ab0af91c7aa01a48d61c4fd 2015-11-03 15:13:05
UTC
tags:         trunk
comment:      Add file and symlink. (user: eas)
check-ins:    2
[little:sandbox] $ ls -l
total 24
-rw-r--r-- 1 eas eas 5 Nov  3 10:14 foo
-rw-r--r-- 1 eas eas 3 Nov  3 10:14 foo.lnk
[little:sandbox] $ rm -f foo.lnk
[little:sandbox] $ fossil update
UPDATE foo.lnk
-------------------------------------------------------------------------------
updated-to:   6171ab90d514f1aa2d2d628680c6eba90dee134c 2015-11-03 15:13:56
UTC
tags:         trunk
comment:      Add file and symlink. (user: eas)
changes:      1 file modified.
 "fossil undo" is available to undo changes to the working checkout.
[little:sandbox] $ ls -l
total 16
-rw-r--r-- 1 eas eas 5 Nov  3 10:14 foo
lrwxrwxrwx 1 eas eas 3 Nov  3 10:14 foo.lnk -> foo
[little:sandbox] $

Eric
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to