Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
fix(fetch): use the correct FETCH_HEAD from within a worktree#1108
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix(fetch): use the correct FETCH_HEAD from within a worktree#1108
Uh oh!
There was an error while loading.Please reload this page.
Conversation
FETCH_HEAD is one of the symbolic references local to the currentworktree and as such should _not_ be looked up in the 'common_dir'. Butinstead of just hard coding the "right thing" (git_dir) lets defer thisto the SymbolicReference class which already contains this knowledge inits 'abspath' property.
Thanks a lot for the fix, the thorough PR description and for trying to even put this into a test. No matter what, this fix should definitely be merged as I have a feeling it did break a lot of things downstream and it's surprising there weren't any bug reports yet. |
muggenhor commentedJan 14, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think I've got some idea why there weren't any yet. My team's been encountering this problem for at least as early as about June 2019 (unfortunately our CI logs don't go further than that). But it was very rare, and we couldn't consistently reproduce it. Then somewhere early in 2020 the frequency of this happening jumped up to close to 100% but our initial attempts to diagnose it where unsuccessfuland we had a simple workaround (disabling the use of multiple nodes in our Jenkins setup to prevent the need to fetch into worktrees from one node to another). My colleague who did that investigation felt, at the time, uncomfortable filing a bug report without having a good reproduction scenario. I later discovered that the cause of this frequency jump was a commit to our meta-CI systemtomtom-international/hopic@14a4338 (that change causes the introduction of a conditional, but almost always occurring, extra It's the combination of fetching first in the top-level and only then fetching in a worktree thatmay cause this bug to cause an exception to be raised. In plenty of other cases you may just silently get wrong results being returned from Then the error we got itself (and the above reproduction script will give with the old version) is also misleading: it's a I still believe there's at least one bug, maybe two, in the processing of I hope that bit of history helps to understand at least partially why this hasn't been reported before. The (feeling of) inability to describe what the problem is is a big obstacle there. Anyway, thanks for your quick response :-) |
Thanks so much for sharing, but… oh my…every paragraph I could feel the time spent and nerves lost and it hurt :/. Even though for GitPython I do believe the fight is lost,there is another endeavour which will definitely reach an entirely new level of quality. Maybe one day it willeven arrive in Python. |
Uh oh!
There was an error while loading.Please reload this page.
FETCH_HEAD
is one of the symbolic references local to the currentworktree and as such shouldnot be looked up in the
common_dir
. Butinstead of just hard coding the "right thing" (
git_dir
) lets defer thisto the
SymbolicReference
class which already contains this knowledge inits
abspath
property.This was introduced by#654. I suspect an overzealous search & replace of
git_dir
->common_dir
was the cause here.FYI: this bug can be reproduced by this Python script. I've not been able to convert that into a test case though: