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

GitPython issues with packed-ref format in Git 2.15+ #65

Closed
pleunv opened this issue Nov 3, 2017 · 9 comments · Fixed by #68
Closed

GitPython issues with packed-ref format in Git 2.15+ #65

pleunv opened this issue Nov 3, 2017 · 9 comments · Fixed by #68

Comments

@pleunv
Copy link

pleunv commented Nov 3, 2017

As of Git 2.15 GitPython has some issues with the new format of packed-ref headers, resulting in PyGitUp crashing whenever doing a git up.

$ git up
Traceback (most recent call last):
  File "C:\Users\Pleun\AppData\Local\scoop\apps\python\3.5.1\scripts\git-up-script.py", line 9, in <module>
    load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
  File "c:\users\pleun\appdata\local\scoop\apps\python\3.5.1\lib\site-packages\git_up-1.3.0-py3.5.egg\EGG-INFO\scripts\gitup.py", line 585, in run
    gitup = GitUp()
  File "c:\users\pleun\appdata\local\scoop\apps\python\3.5.1\lib\site-packages\git_up-1.3.0-py3.5.egg\EGG-INFO\scripts\gitup.py", line 147, in __init__
    if not any(b.tracking_branch() for b in self.repo.branches):
  File "C:\Users\Pleun\AppData\Local\scoop\apps\python\3.5.1\lib\site-packages\gitpython-1.0.0-py3.5.egg\git\repo\base.py", line 237, in heads
    return Head.list_items(self)
  File "C:\Users\Pleun\AppData\Local\scoop\apps\python\3.5.1\lib\site-packages\gitpython-1.0.0-py3.5.egg\git\util.py", line 714, in list_items
    out_list.extend(cls.iter_items(repo, *args, **kwargs))
  File "C:\Users\Pleun\AppData\Local\scoop\apps\python\3.5.1\lib\site-packages\gitpython-1.0.0-py3.5.egg\git\refs\symbolic.py", line 594, in _iter_items
    for sha, rela_path in cls._iter_packed_refs(repo):
  File "C:\Users\Pleun\AppData\Local\scoop\apps\python\3.5.1\lib\site-packages\gitpython-1.0.0-py3.5.egg\git\refs\symbolic.py", line 98, 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 gitpython-developers/GitPython#687 and the PR gitpython-developers/GitPython#689. I'm guessing PyGitUp will need a version bump when a new GitPython version gets released.

@msiemens
Copy link
Owner

msiemens commented Nov 3, 2017

Thanks for the heads-up! I'll keep track of the issue and bump the dependency when GitPython is updated.

@Tatsh
Copy link
Contributor

Tatsh commented Nov 16, 2017

Until the update comes you can do https://github.com/gitpython-developers/GitPython/archive/master.zip. I use a virtualenv so it's no concern to me what happens in it.

@rvanginneken
Copy link

Thanks for the heads-up! I'll keep track of the issue and bump the dependency when GitPython is updated.

I think that time is here. I'm now encountering this issue after an apt update on buntu 16.04.

@msiemens
Copy link
Owner

I think that time is here. I'm now encountering this issue after an apt update on buntu 16.04.

As far as I can see, no new version of GitPython has been released so far. As a workaround installing GitPython from master seems to work:

$ pip install -U git+ssh://git@github.com/gitpython-developers/GitPython.git

Can someone confirm this works?

@pleunv
Copy link
Author

pleunv commented Nov 16, 2017 via email

@mbenatti
Copy link

Here worked with this command: (the comand by @msiemens I got permission denied)

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

@tim-mc
Copy link

tim-mc commented Nov 17, 2017

Alternative method:

Clone repo

git clone https://github.com/gitpython-developers/GitPython
cd GitPython
git submodule update --init --recursive
./init-tests-after-clone.sh

Install GitPython

python setup.py install

Install git-up

pip install git-up

@hugovk
Copy link
Contributor

hugovk commented Dec 4, 2017

See gitpython-developers/GitPython#704 about a new GitPython release.

@hugovk
Copy link
Contributor

hugovk commented Dec 11, 2017

GitPython 2.18 is now out with the fix.

gitpython-developers/GitPython#687 (comment)

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

GitPython 2.18 is now out with the required fix. 

gitpython-developers/GitPython#687 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants