Repository navigation
Refresh Git index prior to fast-forward. - #144
Conversation
Fixes vcstools/wstool#77, see the discussion there for more context.
| return True | ||
| print("Cannot fast-forward, local repository and remote '%s' have diverged." % branch_parent) | ||
| return False | ||
| # Refresh the index manually, just as 'git pull' does it. |
There was a problem hiding this comment.
comment here should explain why, or link to github issue at least.
|
@tkruse Looks like some (unrelated?) "tar" test on Travis failed to download some stuff, maybe you need to restart that build. |
|
Test failure probably caused by #141 |
|
Any update? |
|
Like I mentioned in #141 (comment), the issue this PR tries to solve causes my team an issue almost everyday (requires manually workaround). It'd be great this merges in and new release will be made soon. CI is failing. As suggested at #144 (comment), #141 might have to be processed first (I'm not sure though)? If any help is needed I'm willing to provide just in general for maintenance BTW (I've been comfortably making releases into ROS for years, although never done ROS-standalone package like vcstools). |
|
#141 is merged. Can any admin (@tfoote / @clalancette) restart Travis CI? |
|
reran travis |
|
Travis is happy |
|
Please review @tkruse / @tfoote / @clalancette. |
|
I can reproduce a similar issue like this (changing file permissions before git reset keep, and changing them back): Not sure what else can cause the index to go stale like that in the wild (https://stackoverflow.com/questions/1248029/git-pull-error-entry-foo-not-uptodate-cannot-merge suggests filename case on Mac could cause this. https://stackoverflow.com/questions/878554/why-do-i-sometimes-see-an-entry-filename-not-uptodate-cannot-merge-after-a/878742 also mentions this error happens spuriously). I think the unit tests should be extended with the flow above, even if there is some risk that it cannot be reproduced with all git versions (in that case, tests should be run only for one git version known to reproduce the issue). Another question to consider here is whether |
|
This is really nasty to reproduce in tests. I automated these steps: And the second call to git only fails if I gave the first call to git reset --keep a second to do something unknown in the background. If I remove the sleep, the second call succeeds 9 out of 10 times or so. In case someone else wants to retry this, here is the test source (to be added to test_git.py, run with I'll report to git mailing list just in case. For these tests, not sure if its better to not have tests or to have a brittle test. I can't find a way to smartly wait for whatever needs to finish to reproduce the problem. |
|
@tkruse Thanks for looking deeper into this. I'm also not sure if it's a git bug or just something that one has to know/resolve manually when using such low-level plumbing commands. I believe high-level commands like One nit: I would use full commands like |
|
Feel free to ask for merge in any case, I have no strong objection even without more tests. I would be happy to accept the git behavior as normal low-level plumbing lacking a refresh step, but since it seems to have an asynchronous one that causes race conditions, I am not sure. We'll see if anyone answers https://marc.info/?l=git&m=154755707120508&w=2 |
|
Feel free to merge, especially since several people already complained. |
|
Also, this should trigger a new wstool release soon. For anyone that is blocked by the missing index refresh, just calling |
|
@tfoote @clalancette Please review. @tkruse seems to have approved this at #144 (comment) |
Fixes vcstools/wstool#77, see the discussion
there for more context.