Skip to content

git pull output has changed in git 1.8.5 #142

Description

@migurski

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

Activity

  1. migurski commented on Mar 15, 2014

    @migurski
    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.

  2. benley commented on Apr 8, 2014

    @benley

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

  3. added a commit that references this issue on May 16, 2014
  4. added a commit that references this issue on May 16, 2014
  5. added this to the v0.3.2 milestone on Nov 19, 2014
  6. Byron commented on Nov 19, 2014

    @Byron
    Member

    I believe the fix is already included in the latest release of git-python. Please reopen this issue or comment if not the case.

  7. domino14 commented on Jan 14, 2015

    @domino14

    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?

  8. Byron commented on Jan 14, 2015

    @Byron
    Member

    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

  9. domino14 commented on Jan 14, 2015

    @domino14

    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?

  10. domino14 commented on Jan 14, 2015

    @domino14

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions