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

Error adding 2+ files after init --shared with fscache #3110

Closed
1 task done
stevekmcc opened this issue Mar 12, 2021 · 6 comments
Closed
1 task done

Error adding 2+ files after init --shared with fscache #3110

stevekmcc opened this issue Mar 12, 2021 · 6 comments

Comments

@stevekmcc
Copy link

stevekmcc commented Mar 12, 2021

  • 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.30.2.windows.1
cpu: x86_64
built from commit: 37f0a4afad027cf030747a1ef45537ba86162960
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
  • 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.867] 64-bit
  • What options did you set as part of the installation? Or did you choose the
    defaults?
All defaults:
> type "C:\Program Files\Git\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: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Seems independent of machine or disk type (SSD, HDD, external USB HDD)

Details

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

CMD

git init --shared
echo x>x
echo y>y
git add -A
  • What did you expect to occur after running these commands?

The two files are added with no errors

  • What actually happened instead?

error: unable to create temporary file: No such file or directory
error: y: failed to insert into database
error: unable to index file 'y'
fatal: adding files failed

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

(New local repository being created in an empty directory)

If I omit --shared, there is no error
If there is only one file, there is no error
If the echo commands do not have characters, just adding a blank line, there is no error
If I turn off fscache, there is no error (git config --global core.fscache false)
All other filenames and contents also show the problem, for 2+ files
E.g. with files x,y,z,a,b, error happens on b - seems to be 2nd file in alphabetical order
The various GIT_TRACE_* options do not reveal anything useful, just normal setup up to trace: built-in: git add -A
Problem seems to have existed since at least 2017 (Google the 'unable to create temp...' error and git, e.g. https://stackoverflow.com/a/44040893 )
Confirmed in git version 2.26.2.windows.1
Problem does not occur in git version 2.9.3.windows.2 (2016) on Windows 10.0.18363.1316 with fscache

Bug originally reported to git@vger.kernel.org, was asked to post here as seems Windows specific.

@dscho
Copy link
Member

dscho commented Mar 13, 2021

Does it even make sense to use --shared on Windows? The permission model (ACLs) is so different from what Git expects (Unix' simplistic user/group/other read/write/executable model)...

@stevekmcc
Copy link
Author

The same repository is cloned to multiple platforms. The command lines for repository creation and use are automated as part of integrating Git in a tool that works on multiple platforms. I'm not so worried about whether --shared can perfectly emulate the permissions familiar from Unix, more that simple core operations are broken in this case. This issue is about that bug; if anyone wants to suggest better permissions emulation, that could be raised as a separate issue.

@dscho
Copy link
Member

dscho commented Mar 13, 2021

The same repository is cloned to multiple platforms. The command lines for repository creation and use are automated as part of integrating Git in a tool that works on multiple platforms. I'm not so worried about whether --shared can perfectly emulate the permissions familiar from Unix, more that simple core operations are broken in this case. This issue is about that bug;

Have you given it a shot to debug this via gdb? see https://github.com/git-for-windows/git/wiki/Debugging-Git

A good idea would be to set a breakpoint on error_builtin().

if anyone wants to suggest better permissions emulation, that could be raised as a separate issue.

@stevekmcc
Copy link
Author

Have you given it a shot to debug this via gdb? see https://github.com/git-for-windows/git/wiki/Debugging-Git

Sorry, I have no familiarity with the Git code, and precious little with gdb. All I was able to offer was to whittle it down to a minimal reproducible test case.

@dscho
Copy link
Member

dscho commented Mar 19, 2021

I'll leave this open, then, but have to caution you not to expect much. I, for one, am too short on time to play with this right now.

@dscho
Copy link
Member

dscho commented Aug 29, 2023

Closing as stale.

@dscho dscho closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants