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

safe.directory and use of %(prefix)/ for UNC paths #4817

Open
csware opened this issue Feb 14, 2024 · 0 comments
Open

safe.directory and use of %(prefix)/ for UNC paths #4817

csware opened this issue Feb 14, 2024 · 0 comments

Comments

@csware
Copy link

csware commented Feb 14, 2024

Setup

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

git version 2.44.0.rc0.windows.1
cpu: x86_64
built from commit: 5cff971ba4c5c91f881d277bfeb6a88fa8c17745
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

icrosoft Windows [Version 10.0.19045.3996]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
Editor Option: Notepad++
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
Plink Path: C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe
SSH Option: Plink
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled

Details

Git 2.43.0/2.44rc0 work with safe.directory = %(prefix)///nas/share/repo and also safe.directory = //nas/share/repo. The latter case did not work with older version of Git.

When no safe.directory is set, Git 2.43.0/2.44rc0 say:

fatal: detected dubious ownership in repository at '//nas/share/repo'
'//nas/share/repo' is owned by:
	VORDEFINIERT/Administratoren (S-1-5-32-544)
but the current user is:
	XXX/XXX (S-1-5-21-XXX-XXX-XXX-XXX)
To add an exception for this directory, call:

	git config --global --add safe.directory '%(prefix)///nas/share/repo'

What is the recommended way to set safe.directory? Is the latter one a regression?

It would be great if this case (and related cases such as //wsl.localhost/) would explicitly added to the man page of git-config.

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

1 participant