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

gc: Verify du_git_checkout works on Windows #13064

Open
ehuss opened this issue Nov 28, 2023 · 0 comments
Open

gc: Verify du_git_checkout works on Windows #13064

ehuss opened this issue Nov 28, 2023 · 0 comments
Labels
A-git Area: anything dealing with git O-windows OS: Windows P-low Priority: Low S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. Z-gc Nightly: garbage collection

Comments

@ehuss
Copy link
Contributor

ehuss commented Nov 28, 2023

The function du_git_checkout needs some investigation on how it works with Windows.

The way git checkouts work on Unix is that git2 creates a clone from the "db" to the "checkout". The clone uses hard-links into the .git directory so that it doesn't use any additional disk space. However, I'm not sure how this works on Windows. Does it copy the files? Does it use junctions or other styles of links?

If Windows doesn't use some kind of link or COW, then the code in du_git_checkout is not correct because it is not counting the .git directory contents under the assumption that clones are links.

If this is a problem, then there are a few different options:

  • Use a smarter du which knows about hard-links.
  • Use git worktrees instead of clones.
  • Make the !.git pattern depend on the platform.
@ehuss ehuss added A-git Area: anything dealing with git O-windows OS: Windows S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. P-low Priority: Low Z-gc Nightly: garbage collection labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git O-windows OS: Windows P-low Priority: Low S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. Z-gc Nightly: garbage collection
Projects
None yet
Development

No branches or pull requests

1 participant