-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Unlink of file XXX failed. Should I try again? #500
Comments
@gpakosz hmm. Do you think you can come up with a reproducible example? Something like a shell script that creates a small repository, clones it, then sets |
@dscho Something like this?
|
@kgybels very nice! |
Oh nice @kgybels, I added the task in my TODO but I'm thankful you took over. 👍 |
I sometimes have this problem and I believe it is related to TortoiseGit's TGitCache.exe having those files open. |
It's definitely not related to TortoiseGit. As you can see above, @kgybels provided a script that reproduces the problem. It's totally unrelated to any Git frontend |
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. This fixes git-for-windows#500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@gpakosz But is TortoiseGit installed? It can have those files locked even though you are currently using git on the command line. |
@cs96and if TortoiseGit, or for that matter, any software locks pack files, the "Unlink of file XXX failed." is actually the proper response and there is no bug in Git. The bug at hand is caused by Git itself keeping locks on the files that it wants to garbage-collect. And that bug is what I just fixed. |
Not just TortoiseGit, Atom text editor also sometimes locks the packfile too. |
Well, Atom text editor is included in "any software", no? Apart from that, what business does Atom text editor have to lock pack files? Seriously. |
@dscho, because it's more of an IDE (written in HTML5 on top of node.js and craploads of other bits of what is considered "hot stuff" these days) than a text editor. IDEs strive to provide VCS integration. Supposedly they're using All in all, failing to lock a locked file is for sure the only sensible way to go IMO. |
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. This fixes git-for-windows#500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho no worry, thanks for taking care of fixing it, much appreciated |
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. This fixes git-for-windows#500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This hit upstream's |
@gpakosz note that in Open Source, you can always work on your own itches... 😃 |
@dscho That's true. I confess I never really tried to climb the learning curve of being able to compile and debug Git For Windows. And the first years it was all too easy to blame NTFS ;) |
It's always easy to blame NTFS. And for the record: when I started working on Git, I also had no idea how to compile and debug Git for Windows... |
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. This fixes #500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This fixes #500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There is a regression from |
Thanks! Can you let me know when it gets into |
Teach gc --auto to clear the repository before auto packing it to prevent failures when removing files on Windows. Also teach the test 'fetching with auto-gc does not lock up' to complain when it is no longer triggering an auto packing of the repository. Fixes git-for-windows#500 Signed-off-by: Kim Gybels <kgybels@infogroep.be> Helped-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Teach gc --auto to release pack files before auto packing the repository to prevent failures when removing them. Also teach the test 'fetching with auto-gc does not lock up' to complain when it is no longer triggering an auto packing of the repository. Fixes git-for-windows#500 Signed-off-by: Kim Gybels <kgybels@infogroep.be> Signed-off-by: Junio C Hamano <gitster@pobox.com>
I opened a PR. Thank you so much! |
Hello,
Sometimes, after a e.g.
git fetch
, Git decides to auto GC a repository. In the process, it fails to remove.pack
and.idx
files. Likely, those files are locked.Git can ask the question for more than 50 times depending on the number of unreachable commits there are following branch deletion and remotes pruning. When Git starts to complain, either you answer "no" repeatedly until the auto GC ends, or you have to CTRL-C. Ultimately, invoking
git gc
manually removes most of the pack filesThe text was updated successfully, but these errors were encountered: