Request for help: wiki page on symbolic links

33 views
Skip to first unread message

Johannes Schindelin

unread,
Aug 26, 2015, 12:37:48 PM8/26/15
to git-for...@googlegroups.com, msy...@googlegroups.com
Hi all,

as most of you know, we have some support for symbolic links with Git
for Windows 2.x. However, there are a couple of caveats. I started a
wiki page listing these:

https://github.com/git-for-windows/git/wiki/Symbolic-Links

Now, I am *certain* that I forgot some details, or that I even got them
wrong. So please, could everybody who cares about symbolic links head
there and correct my mistakes and omissions?

Thank you,
Johannes

David Macek

unread,
Aug 27, 2015, 2:26:27 AM8/27/15
to johannes....@gmx.de, git-for...@googlegroups.com, msy...@googlegroups.com
On 26. 8. 2015 18:37, Johannes Schindelin wrote:
> Hi all,
>
> as most of you know, we have some support for symbolic links with Git for Windows 2.x. However, there are a couple of caveats. I started a wiki page listing these:
>
> https://github.com/git-for-windows/git/wiki/Symbolic-Links

Great.

> Now, I am *certain* that I forgot some details, or that I even got them wrong. So please, could everybody who cares about symbolic links head there and correct my mistakes and omissions?

I have revised the page using information from my head and from https://github.com/git-for-windows/git/issues/117. I'm not completely sure on the wording though.

New text of the changed bullet points:

> Symbolic links on remote filesystems are disabled by default (call fsutil behavior query SymlinkEvaluation to find out)
>
> You need the SeCreateSymbolicLinkPrivilege privilege (which is by default assigned only to Administrators; also requires UAC elevation for any Administrators member, regardless of privilege assignment)

--
David Macek

David Macek

unread,
Aug 27, 2015, 2:33:33 AM8/27/15
to bald...@gmail.com, git-for...@googlegroups.com, msy...@googlegroups.com
On 26. 8. 2015 22:42, Baldurien wrote:
> 1. I don't know if junction are in the scope of this privilege. This small tool allow to create such: https://technet.microsoft.com/en-us/sysinternals/bb896768 Junction are pretty much like symbolic links on folder, and it exists since Windows 2000.

You can also create them with `mklink /j`. They are not bound by this privilege, any user can create junctions. Their limitation to directories unfortunately makes them pretty unusable for git, in my opinion.

> 2. In what case do people use symbolic links in a git repository ?

Not completely sure. I, too, would like to read someone's argument why symlinks in repositories are useful.

I do have an example though, see https://github.com/elieux/pacman/tree/master/src/util.

--
David Macek

Johannes Schindelin

unread,
Aug 27, 2015, 3:15:44 AM8/27/15
to David Macek, git-for...@googlegroups.com, msy...@googlegroups.com
Hi David,

On 2015-08-27 08:26, David Macek wrote:
> On 26. 8. 2015 18:37, Johannes Schindelin wrote:
>
>> as most of you know, we have some support for symbolic links with Git
>> for Windows 2.x. However, there are a couple of caveats. I started a
>> wiki page listing these:
>>
>> https://github.com/git-for-windows/git/wiki/Symbolic-Links
>
> I have revised the page using information from my head and from
> https://github.com/git-for-windows/git/issues/117. I'm not completely
> sure on the wording though.

Thank you! Looks pretty good to me.

Ciao,
Johannes

Baldurien

unread,
Aug 27, 2015, 3:16:24 AM8/27/15
to git-for-windows, msy...@googlegroups.com
Hello,

I know that you can't create symlink by default on WIndows 7 with Standard user (not admin) because the privilege you mention is not there. You need to enable it using secpol.msc (Professionals edition only), I can't tell you the location in English, but in French it is there: Stratégies locales > Attributions des droits utiisateurs > Création de liens symboliques

Also this Shell extension (I like it, it is very good when dealing with Junction) provide some more information: http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html#symboliclinks

Beside, not related to the wiki page, but :

1. I don't know if junction are in the scope of this privilege. This small tool allow to create such: https://technet.microsoft.com/en-us/sysinternals/bb896768 Junction are pretty much like symbolic links on folder, and it exists since Windows 2000.
2. In what case do people use symbolic links in a git repository ?


Regards,
Baldurien

Baldurien

unread,
Aug 29, 2015, 3:55:57 PM8/29/15
to git-for-windows, bald...@gmail.com, msy...@googlegroups.com


Le jeudi 27 août 2015 09:16:05 UTC+2, David Macek a écrit :
On 26. 8. 2015 22:42, Baldurien wrote:
> 1. I don't know if junction are in the scope of this privilege. This small tool allow to create such: https://technet.microsoft.com/en-us/sysinternals/bb896768 Junction are pretty much like symbolic links on folder, and it exists since Windows 2000.

You can also create them with `mklink /j`. They are not bound by this privilege, any user can create junctions. Their limitation to directories unfortunately makes them pretty unusable for git, in my opinion.

If that is true, then that is completely stupid... well ... they probably forgot the existence of junction while implementing (and adding permissions) symlinks...
 

> 2. In what case do people use symbolic links in a git repository ?

Not completely sure. I, too, would like to read someone's argument why symlinks in repositories are useful.

I do have an example though, see https://github.com/elieux/pacman/tree/master/src/util.

Perhaps there is a real reason, but I don't see the need of a link in that case. Adding the directory (and static library) should be sufficient...
Or worse: #include "../common/util-common.c" :P

Any other example ?

 
--
David Macek

duane....@gmail.com

unread,
Aug 30, 2015, 3:56:00 PM8/30/15
to Git for Windows, git-for...@googlegroups.com, bald...@gmail.com

On Thursday, August 27, 2015 at 12:16:24 AM UTC-7, Baldurien wrote:
2. In what case do people use symbolic links in a git repository ?

Symbolic links are useful for test data files. Our test system uses data files to represent the data under test. It is common for these same files to be used by many tests. The use of symbolic links to a these test data files helps to keep the test environment self contained. Much more efficient than copying the files repeatedly.

For example

test/
    MyTest/
        /resources
            [symbolic links to shared data files]
        /src
            [sources for uni tests]


David Macek

unread,
Aug 31, 2015, 2:20:53 AM8/31/15
to duane....@gmail.com, msy...@googlegroups.com, git-for...@googlegroups.com, bald...@gmail.com
Not that it matters, but I'm not yet convinced. :)

This is a perfect job for repository-level de-duplication, hardlinks and/or filesystem-level de-duplication.

--
David Macek

Reply all
Reply to author
Forward
0 new messages