Skip to content

git pull output has changed in git 1.8.5 #142

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

Closed
migurski opened this issue Mar 15, 2014 · 8 comments
Closed

git pull output has changed in git 1.8.5 #142

migurski opened this issue Mar 15, 2014 · 8 comments
Milestone

Comments

@migurski
Copy link

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

…and:

 * branch            f38f44fb-e990-4b72-8a0f-c7994157f6a6 -> FETCH_HEAD
 = [up to date]      f38f44fb-e990-4b72-8a0f-c7994157f6a6 -> origin/f38f44fb-e990-4b72-8a0f-c7994157f6a6
@migurski
Copy link
Author

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.

migurski added a commit to migurski/git-jekyll-cms that referenced this issue Mar 16, 2014
@benley
Copy link

benley commented Apr 8, 2014

This particular bug is driving me up the wall. If anybody's got a working fix it would be greatly appreciated.

nefaspartim pushed a commit to nefaspartim/GitPython that referenced this issue May 16, 2014
Byron added a commit that referenced this issue May 16, 2014
Fix for #142. Simply ignores lines that begin with ' ='
@ghost
Copy link

ghost commented Jul 3, 2014

+1, works with git version 2.0.0 on linux. Thanks!

@Byron Byron added this to the v0.3.2 milestone Nov 19, 2014
@Byron
Copy link
Member

Byron commented 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.

@Byron Byron closed this as completed Nov 19, 2014
@domino14
Copy link

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
Copy link
Member

Byron commented 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
Copy link

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
Copy link

I put the above information in a new issue: #232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants