Skip to content
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

PackingType of packed-Refs not understood: '# pack-refs with: peeled fully-peeled sorted' #687

Closed
apexo opened this issue Oct 11, 2017 · 15 comments · Fixed by redkyn/assigner#111

Comments

@apexo
Copy link

apexo commented Oct 11, 2017

File "/usr/lib/python2.7/dist-packages/git/repo/base.py", line 335, in tags
  return TagReference.list_items(self)
File "/usr/lib/python2.7/dist-packages/git/util.py", line 932, in list_items
  out_list.extend(cls.iter_items(repo, *args, **kwargs))
File "/usr/lib/python2.7/dist-packages/git/refs/symbolic.py", line 613, in _iter_items
  for sha, rela_path in cls._iter_packed_refs(repo):  # @UnusedVariable
File "/usr/lib/python2.7/dist-packages/git/refs/symbolic.py", line 97, in _iter_packed_refs
  raise TypeError("PackingType of packed-Refs not understood: %r" % line)

I guess the "sorted" token can be safely ignored; _iter_packed_refs() could probably be somewhat improved by adding a whitelist of supported tokens, the current code looks a bit fragile (but then, I don't know what the syntax and semantics for the packed-refs header is).

@bjb
Copy link

bjb commented Oct 13, 2017

See pull request #689. i had the same problem after upgrading git.

@JasonMWhite
Copy link

👋 We're hitting the same issue now that brew is upgrading our users' git to 2.15. Any way we could get a 2.1.8 release out with this patch?

@HariSekhon
Copy link

Same problem:

    branches = repo.branches

  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/git/repo/base.py", line 267, in heads

    return Head.list_items(self)

  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/git/util.py", line 942, in list_items

    out_list.extend(cls.iter_items(repo, *args, **kwargs))

  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/git/refs/symbolic.py", line 609, in _iter_items

    for sha, rela_path in cls._iter_packed_refs(repo):  # @UnusedVariable

  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/git/refs/symbolic.py", line 100, in _iter_packed_refs

    raise TypeError("PackingType of packed-Refs not understood: %r" % line)

TypeError: PackingType of packed-Refs not understood: '# pack-refs with: peeled fully-peeled sorted'

See full build log here:

https://travis-ci.org/HariSekhon/pytools/builds/298554130#L6405

@JasonMWhite
Copy link

The fix has been merged to master, the next time a release is cut we should be all set.

@paulbovbel
Copy link

Can I request a release with this patch included please? Git 2.15 is the stable release as of Oct 30th.

@nuzz
Copy link

nuzz commented Nov 13, 2017

Is there an ETA on when you'll package a v2.1.8 release that includes this fix?

@damian-lewkowicz
Copy link

Any news?

Workaround - install unreleased version :)

pip install -U git+http://github.com/gitpython-developers/GitPython.git

@ignatenkobrain
Copy link

Or install packaged version in your $distro which has patch :P

@hugovk
Copy link
Contributor

hugovk commented Dec 4, 2017

See #704 about a new release.

@Byron Byron added this to the v2.1.8 - Bugfixes milestone Dec 11, 2017
@Byron
Copy link
Member

Byron commented Dec 11, 2017

I am closing this issue in preparation for the next release, which contains the fix. I am sorry for having let you wait for so long!

@Byron Byron closed this as completed Dec 11, 2017
@truthdoug
Copy link

Rather than closing in preparation for the release, would you consider re-opening and then closing once the release is available? That way those of us who subscribe to notifications on this issue will be alerted to the availability of the new release.

@JasonMWhite
Copy link

Thanks @Byron ! I appreciate it :)

@Byron
Copy link
Member

Byron commented Dec 11, 2017

@truthdoug I totally agree, and fortunately the waiting is over now: https://pypi.python.org/pypi/GitPython

msiemens pushed a commit to msiemens/PyGitUp that referenced this issue Dec 11, 2017
Fix #65. 

GitPython 2.18 is now out with the required fix. 

gitpython-developers/GitPython#687 (comment)
davidvuong added a commit to Nirovision/mimiron that referenced this issue Jan 18, 2018
LinuxMercedes added a commit to redkyn/assigner that referenced this issue Feb 9, 2018
LinuxMercedes added a commit to redkyn/assigner that referenced this issue Feb 9, 2018
@pmb311
Copy link

pmb311 commented Oct 2, 2018

I hit this issue and have limited control of getting the upgrade -- if anyone is in a similar situation you can workaround it by calling repo.git.tag().

@Byron
Copy link
Member

Byron commented Oct 14, 2018

@pmb311 I believe you can always monkey-patch the code, based on the fix that has been released by now. Do you think that will work?

wmfgerrit pushed a commit to wikimedia/integration-zuul-config that referenced this issue Aug 18, 2020
python3-git in Stretch is 2.1.1 which does not work with git 2.15+
leading to build failing with:

  PackingType of packed-Refs not understood:
  '# pack-refs with: peeled fully-peeled sorted'

gitpython-developers/GitPython#687

The fix is to use GitPython 2.1.8 or later which is listed as
requirement in Quibble. Thus let the virtualenv install the proper
version.

Buster is not affected since python3-git is 2.1.11.

Bug: T256844
Change-Id: I073108049efc29b0fa1cbf7458d3ff9be3cb9aae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.