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

Windows version 2.36.0 breaks hooks when pushing to a bare repository located on a DFS #3825

Closed
Balkoth opened this issue Apr 27, 2022 · 8 comments
Labels

Comments

@Balkoth
Copy link

Balkoth commented Apr 27, 2022

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.36.0.windows.1
cpu: x86_64
built from commit: ea1e13f73339d57cbe81a0bae6fba669aaccf656
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • 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.19041.1415]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: ConHost
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Bare repositories with hooks are located on a Windows DFS.

Details

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

Bash

git push
  • What did you expect to occur after running these commands?

As with version 2.35.3 i expect the hooks in the bare repository to run.

  • What actually happened instead?
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 248 bytes | 124.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: sh: hooks/post-receive: Too many levels of symbolic links
To I:/SourceControl/Sharepoint/Test.git
   e8ccdf4..03d48af  master -> master

As shown here, the hook 'post-receive' did not run, while downgrading to 2.35.3 executes the hook successfully. I don't know which information is needed in order to solve the issue, but will be looking to provide any of them if asked.

@rimrul rimrul added the msys2 label Apr 27, 2022
@dscho
Copy link
Member

dscho commented Apr 27, 2022

This looks like #3669 (comment).

@Balkoth could you start a Git Bash and try to call cd /i/? If that fails with the same error message could you install Cygwin and try the same?

@Balkoth
Copy link
Author

Balkoth commented Apr 27, 2022

Same problem:

$ cd /i/
bash: cd: /i/: Too many levels of symbolic links

I don't know how to setup cygwin bash:

$ cd /i/
bash: cd: /i/: No such file or directory

@Narrat
Copy link

Narrat commented Apr 27, 2022

Still necessary to open a dedicated issue, or will this be renamed? Want to avoid to open a duplicate.
But nevertheless my informations:

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.36.0.windows.1
cpu: x86_64
built from commit: ea1e13f73339d57cbe81a0bae6fba669aaccf656
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • 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.19044.1682]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Disabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Nothing

Details

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

This happens with the Bash. Either running on its own or via the Windows terminal.

Changing the working directory to a network drive doesn't work anymore like with previous git-for-windows versions (latest working version: 2.35.3) and fails with Too many levels of symbolic links.

$ cd /u
bash: cd: /u: Too many levels of symbolic links
  • What did you expect to occur after running these commands?

A succesfull change of the working directory

  • What actually happened instead?

It fails with the above mentioned error message. But in general it seems to be possible, as a Bash can be opened on a network drive with Git Bash here. Displayed as expected as:

<user>@<host> MINGW64 /u
$

Switching to different local drives still works:

<user>@<host> MINGW64 /
$ cd /d

<user>@<host> MINGW64 /d
$

As I was asked to report what happens with cygwin: I simply installed the base setup. Assuming the checked behaviour should be set as default, this happens when I try to switch to a network drive:

$ cd /u
-bash: cd: /u: No such file or directory

But as it also fails with the local drive /d I assume I need to do something additional which I'm not aware of.

@dscho
Copy link
Member

dscho commented Apr 27, 2022

@Balkoth in Cygwin, you need to cd /cygdrive/i/

@Balkoth
Copy link
Author

Balkoth commented Apr 28, 2022

$ cd /cygdrive/i/
-bash: cd: /cygdrive/i/: Too many levels of symbolic links

@dscho
Copy link
Member

dscho commented Apr 28, 2022

Okay, that confirms that this is a Cygwin problem.

Could you download https://github.com/git-for-windows/msys2-runtime/suites/5723433653/artifacts/189221093 and replace your existing C:\Program Files\Git\usr\bin\msys-2.0.dll with the one contained in the downloaded archive? It is a build that integrates some fixes that are not yet included in any official Cygwin version but will be in v3.3.5.

@Balkoth
Copy link
Author

Balkoth commented Apr 28, 2022

I can confirm that changing into the drive as well as calling the hooks works with the dll you provided.

@dscho
Copy link
Member

dscho commented Apr 28, 2022

I can confirm that changing into the drive as well as calling the hooks works with the dll you provided.

Hooray! I guess we'll need to build a new MSYS2 runtime soon ;-)

dscho added a commit to git-for-windows/msys2-runtime that referenced this issue May 8, 2022
Seeing as Git for Windows tries to stay close to the upstream MSYS2
project, it makes sense to integrate their patches verbatim.

Here, we rebase to the current work-in-progress because the Cygwin
runtime v3.3.5 has not yet been released, yet Git for Windows needs some
fixes that were not yet in v3.3.4, most notably the "Too many levels of
symbolic links" problem with network shares.

This fixes git-for-windows/git#3825

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to git-for-windows/build-extra that referenced this issue May 9, 2022
A bug introduced into v2.36.0 where [shell scripts failed to run
on some network shares with the error "Too many levels of symbolic
links"](git-for-windows/git#3825) was fixed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/msys2-runtime that referenced this issue May 13, 2022
Seeing as Git for Windows tries to stay close to the upstream MSYS2
project, it makes sense to integrate their patches verbatim.

This fixes git-for-windows/git#3825

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants