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

Sparse-checkout fails to delete junction points when deleted out of order #5116

Open
1 task done
derrickstolee opened this issue Aug 29, 2024 · 0 comments
Open
1 task done

Comments

@derrickstolee
Copy link

  • 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?

I'm using the microsoft/git fork, but I don't expect the problem to be in the code that is custom to that fork.

$ git version --build-options
git version 2.46.0.vfs.0.0
cpu: x86_64
built from commit: 081a80eda51c258b0a2a3b9fc786143d03edc926
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.9.0
OpenSSL: OpenSSL 3.2.2 4 Jun 2024
zlib: 1.3.1
  • 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.26120.1542]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled

Details

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

Issue happens in Git Bash or CMD (though my setup requires CMD)

(in bash)
git init junction-test
cd junction-test
echo "**/ignored/" >.gitignore
mkdir dir1
mkdir dir2
echo bogus >a
echo bogus >dir1/a
echo bogus >dir2/a
git add .
git commit -m "base"
mkdir -p dir1/ignored/target
mkdir dir2/ignored

(now, in CMD)
mklink /J dir2\ignored\source dir2\ignored\target

(now, in any shell)
git sparse-checkout set
  • What did you expect to occur after running these commands?

git sparse-checkout set should have no error output and the only file in the working dir should be a. (In a more general case, the directories that live outside of the sparse-checkout should not exist.)

  • What actually happened instead?
$ git sparse-checkout set
warning: could not open directory 'dir2/ignored/source/': No such file or directory
warning: failed to remove directory 'dir2/'

$ ls
a        dir2/

Context Notes

This example is contrived, but matches the behavior of an internal monorepo that uses junction points between shared contents of node_modules directories to save space when building Javascript components. This behavior is causing performance issues with the sparse index as alerted by the new advice message in Git 2.46.0.

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