Symbolic Links

313 views
Skip to first unread message

Dakota Hawkins

unread,
Nov 4, 2016, 11:49:45 AM11/4/16
to git-for-windows
Hi all,

First, thanks for the great work including a new option to enable
symbolic links and for the excellent explanation of windows symlinks
on the wiki!

I was wondering if enabling symlink support will make any difference
in "backend" git operation. I.e. are there internal uses of symlinks
this enables that might save disk space or improve file I/O efficiency
when the user isn't explicitly creating or managing symlinks.

Whether there are or are not, do you think it would be worth stating
on the wiki?

Thanks,

Dakota

Johannes Schindelin

unread,
Nov 4, 2016, 12:18:24 PM11/4/16
to Dakota Hawkins, git-for-windows
Hi Dakota,

On Fri, 4 Nov 2016, Dakota Hawkins wrote:

> First, thanks for the great work including a new option to enable
> symbolic links and for the excellent explanation of windows symlinks
> on the wiki!

You're welcome! I will forward your thanks to my colleagues who prodded me
into adding the symbolic links checkbox to the installer, too.

> I was wondering if enabling symlink support will make any difference
> in "backend" git operation. I.e. are there internal uses of symlinks
> this enables that might save disk space or improve file I/O efficiency
> when the user isn't explicitly creating or managing symlinks.

This feature only makes a difference when the repository tracks symbolic
links, i.e. when cloning a repository with entries whose file mode is
120000, or when adding entries that were created using `mklink` (or
anything equivalent).

If there *are* tracked symbolic links, it *does* make a difference whether
core.symlinks is set to true or false: If it is "false", Git will not try
to create symbolic links but instead it will create plain files whose
contents reflect the target of the symbolic link. That is more of a crude
workaround, of course, as the symbolic link will *not* work if it is a
file instead. But it was necessary to support checking out Git's own
source code, as it contains a symbolic link called "RelNotes".

Please note also: the checkbox in the installer is not *really* necessary.

What I mean by this is: when a repository is initialized (via `git init`
or via `git clone ...`), Git for Windows tests whether it can create
symbolic links, and when that test fails, core.symlinks is set to false in
the newly-initialized .git/config.

As a consequence, it does not really matter whether the installer sets
that config variable or not.

I still added the checkbox because it provided a convenient spot to tell
users about this feature, i.e. that it exists, and where to read more
about it.

> Whether there are or are not, do you think it would be worth stating
> on the wiki?

I am *always* happy when the wiki pages are improved! Feel free to do so!

Thanks,
Johannes
Reply all
Reply to author
Forward
0 new messages