I’m seeing new errors resulting from changes to git 1.8.5 output, in remote.py line 539 and 605. Looks connected to issues #133 and #138:
File "/Users/migurski/Sites/tmp/CMS/bizarro/repo.py", line 68, in save_working_file
clone.remotes.origin.pull(branch_name, rebase=True)
File "/Users/migurski/Sites/tmp/CMS/venv-cms/lib/python2.7/site-packages/git/remote.py", line 605, in pull
return self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())
File "/Users/migurski/Sites/tmp/CMS/venv-cms/lib/python2.7/site-packages/git/remote.py", line 539, in _get_fetch_info_from_stderr
assert len(fetch_info_lines) == len(fetch_head_info), "len(%s) != len(%s)" % (fetch_head_info, fetch_info_lines)
AssertionError: len(["b2ae1672985fa90a09546504014cf58da122c766\t\tbranch 'f38f44fb-e990-4b72-8a0f-c7994157f6a6' of /var/folders/_0/1_xvzf1d7617_1qnntjkb1zm0000gn/T/bizarro-cqQlQ3\n"]) != len([' * branch f38f44fb-e990-4b72-8a0f-c7994157f6a6 -> FETCH_HEAD', ' = [up to date] f38f44fb-e990-4b72-8a0f-c7994157f6a6 -> origin/f38f44fb-e990-4b72-8a0f-c7994157f6a6'])
The outputs being compared:
b2ae1672985fa90a09546504014cf58da122c766 branch 'f38f44fb-e990-4b72-8a0f-c7994157f6a6' of /var/folders/_0/1_xvzf1d7617_1qnntjkb1zm0000gn/T/bizarro-cqQlQ3
I am using GitPython 0.3.5 and git 1.8.3.4 and this is broken for me. The length of the first thing it's comparing is 812 elements and the second is 811 elements. I don't necessarily want to attach a gigantic list of branch names here but what is the best way to debug this?
The reason it may appear broken is that in git-python 0.3.5, the assertion was re-added in a slightly different form. It's meant to prevent Fetch-information to be truncated, which is what would have happened in git-versions prior to that.
Therefore I hoped by putting this assertion to finally learn why it may still fail.
I would be glad if you could help me to reproduce this issue - either by providing me with steps to do it myself or by getting access to the data involved. The latter would be each line in my_progress_handler and the entire contents of the FETCH_HEAD.
In the meanwhile, to solve your problem, probably even without causing side-effects, you can just remove the assertion in your code, or switch back to git-python 0.3.4.
Please note that I am somewhat hesitant to reopen this issue, as yours is not exactly the same. In case you want to provide the requested information, you could do so in a new issue.
I wrote a script to parse the two things that it is trying to compare. FETCH_HEAD right now has 813 lines. The output of git fetch, when I run it manually on the command line (I have not been able to figure out exactly what command it is running, but I'm assuming it's git fetch --all -v - is this correct?) has also 813 lines if you ignore the first two lines: Fetching origin and From github.com:org/repo
However, the very last branch in FETCH_HEAD is missing in the GitPython fetch output, in my case it is this line:
a3a81646dd65dfa4b4412c0f3a5fd4183cbaa2e5 not-for-merge branch 'zendesk' of github.com:org/repo
It can't find the matching line in the fetch output:
= [up to date] zendesk -> origin/zendesk
Even though I see the above line when I do git fetch --all -v, I don't see it in the GitPython assert output. Let me know if you need more info. Is there possibly some length limit?
BTW I was using GitPython==0.3.2.RC1 prior to this and it was still failing an assertion, although I'm not sure the assertion was exactly the same. Do you think 0.3.4 will fix this temporarily?
Activity
migurski commented on Mar 15, 2014
These errors first appeared when I upgraded to git 1.8.5. I’m not sure what the previous version of git was, but I got it via XCode on Mavericks.
Switched to subprocess-style git commands.
benley commented on Apr 8, 2014
This particular bug is driving me up the wall. If anybody's got a working fix it would be greatly appreciated.
Fix for gitpython-developers#142. Simply ignores lines that begin wit…
Merge pull request #163 from nefaspartim/bugfix-142
Byron commented on Nov 19, 2014
I believe the fix is already included in the latest release of git-python. Please reopen this issue or comment if not the case.
domino14 commented on Jan 14, 2015
I am using GitPython 0.3.5 and git 1.8.3.4 and this is broken for me. The length of the first thing it's comparing is 812 elements and the second is 811 elements. I don't necessarily want to attach a gigantic list of branch names here but what is the best way to debug this?
Byron commented on Jan 14, 2015
The reason it may appear broken is that in git-python 0.3.5, the assertion was re-added in a slightly different form. It's meant to prevent Fetch-information to be truncated, which is what would have happened in git-versions prior to that.
Therefore I hoped by putting this assertion to finally learn why it may still fail.
I would be glad if you could help me to reproduce this issue - either by providing me with steps to do it myself or by getting access to the data involved. The latter would be each line in my_progress_handler and the entire contents of the FETCH_HEAD.
In the meanwhile, to solve your problem, probably even without causing side-effects, you can just remove the assertion in your code, or switch back to git-python 0.3.4.
Please note that I am somewhat hesitant to reopen this issue, as yours is not exactly the same. In case you want to provide the requested information, you could do so in a new issue.
Thank you
domino14 commented on Jan 14, 2015
I wrote a script to parse the two things that it is trying to compare. FETCH_HEAD right now has 813 lines. The output of git fetch, when I run it manually on the command line (I have not been able to figure out exactly what command it is running, but I'm assuming it's git fetch --all -v - is this correct?) has also 813 lines if you ignore the first two lines: Fetching origin and From github.com:org/repo
However, the very last branch in FETCH_HEAD is missing in the GitPython fetch output, in my case it is this line:
a3a81646dd65dfa4b4412c0f3a5fd4183cbaa2e5 not-for-merge branch 'zendesk' of github.com:org/repo
It can't find the matching line in the fetch output:
= [up to date] zendesk -> origin/zendesk
Even though I see the above line when I do git fetch --all -v, I don't see it in the GitPython assert output. Let me know if you need more info. Is there possibly some length limit?
BTW I was using GitPython==0.3.2.RC1 prior to this and it was still failing an assertion, although I'm not sure the assertion was exactly the same. Do you think 0.3.4 will fix this temporarily?
domino14 commented on Jan 14, 2015
I put the above information in a new issue: #232