Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git config overwrites symbolic links #958

Closed
1 task done
rpaquay opened this issue Nov 15, 2016 · 2 comments
Closed
1 task done

git config overwrites symbolic links #958

rpaquay opened this issue Nov 15, 2016 · 2 comments
Milestone

Comments

@rpaquay
Copy link

rpaquay commented Nov 15, 2016

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.9.2.windows.1
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.10586]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
> type "C:\Program Files\Git\etc\install-options.txt"
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

n/a

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Cmd ("As Administrator")

(Run cmd.exe "As Administrator" to allow symbolic link creation)
> git init
> copy .git\config git.config
> del .git\config
> mklink .git\config ..\git.config
> dir .git\config
> git config core.filemode false --replace-all
> dir .git\config
  • What did you expect to occur after running these commands?

The last dir .git\config command shows that the file is a SYMLINK:

11/15/2016  11:22 AM    <SYMLINK>      config [..\git.config]
  • What actually happened instead?

The last dir .git\config command shows that the SYMLINK has been replaced by a file:

11/15/2016  11:22 AM               148 config
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

The problem is not specific to a particular repository. Even though the example seems trivial, the issue is actually affecting "real-world" examples, specifically people using the https://code.google.com/p/git-repo/ tool to handle multiple repository. The git-repo tool create many symblic links in ".git" directories, and it does not expect these symbolic links to be replaced by regular files.

Note that git for cygwin preserves symlinks with a similar set of commands.

@dscho
Copy link
Member

dscho commented Nov 16, 2016

git version 2.9.2.windows.1

This is really old by now. There have been 2.9.3, 2.9.3(2), 2.10.0, 2.10.1 and 2.10.2 in the meantime.

Nevertheless, I tested it and figured out what goes wrong: our readlink() implementation only tries to read symbolic links when core.symlinks = true. That config setting pays tribute to various issues with symbolic links on Windows.

But we should read symbolic links whenever we encounter one, regardless of our ability to create symbolic links.

@dscho dscho closed this as completed in 300f346 Nov 16, 2016
@dscho dscho added this to the v2.11.0 milestone Nov 16, 2016
dscho added a commit to git-for-windows/build-extra that referenced this issue Nov 16, 2016
When encountering a symbolic link, Git [now always tries to read
it](git-for-windows/git#958), not only when
`core.symlinks = true`.

Signed-off-by: Johannes Schindelin <[email protected]>
@rpaquay
Copy link
Author

rpaquay commented Nov 16, 2016

Thank you so much for the quick fix!

dscho added a commit that referenced this issue Nov 17, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Nov 17, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Nov 18, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Nov 24, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Nov 29, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Nov 29, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Nov 30, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Dec 6, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Dec 12, 2016
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 11, 2017
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 18, 2017
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 18, 2017
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 18, 2017
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 2, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 18, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 20, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Jan 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Feb 16, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Mar 23, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Apr 3, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue May 29, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue May 29, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Aug 22, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Aug 28, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 5, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 10, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 11, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes git-for-windows#958

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 24, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Oct 10, 2018
Regardless whether we think we are able to create symbolic links, we
should always read them.

This fixes #958

Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants