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

git-up could be more resilient to deleted branches #4

Closed
velo opened this issue Jun 4, 2013 · 11 comments
Closed

git-up could be more resilient to deleted branches #4

velo opened this issue Jun 4, 2013 · 11 comments
Assignees

Comments

@velo
Copy link

velo commented Jun 4, 2013

If the remote branch get deleted I get the following error:

Marvin@marvin-note ~/contaazul
$ git up
Fetching origin
develop           up to date
feature/API-2     Traceback (most recent call last):
  File "/usr/bin/git-up", line 8, in <module>
    load_entry_point('git-up==0.1', 'console_scripts', 'git-up')()
  File "/usr/bin/gitup.py", line 294, in run
    GitUp().run()
  File "/usr/bin/gitup.py", line 103, in run
    self.rebase_all_branches()
  File "/usr/bin/gitup.py", line 138, in rebase_all_branches
    if remote.commit.hexsha == branch.commit.hexsha:
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 168, in _get_commit
    obj = self._get_object()
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 161, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 115, in dereference_recursive
    hexsha, ref_path = cls._get_ref_info(repo, ref_path)
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 142, in _get_ref_info
    raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/remotes/origin/feature/API-2' does not exist
@ghost ghost assigned msiemens Jun 5, 2013
@msiemens
Copy link
Owner

msiemens commented Jun 5, 2013

Fixed in v0.2.3, you can update it via pip install -U git-up :)

msiemens added a commit that referenced this issue Jun 5, 2013
@velo
Copy link
Author

velo commented Jun 5, 2013

Awesome, lemme try....
...
...
...
It works my friend... many thanks!

@msiemens
Copy link
Owner

msiemens commented Jun 5, 2013

👍

@velo
Copy link
Author

velo commented Jun 19, 2013

Hey man, a pattern rise up here, I need to run git up twice to get it workin

Marvin@marvin-note ~/**(release/20130620a)
$ git up
Fetching origin
develop            fast-forwarding...
feature/CA-1572    Traceback (most recent call last):
  File "/usr/bin/git-up", line 8, in <module>
    load_entry_point('git-up==0.1', 'console_scripts', 'git-up')()
  File "/usr/bin/gitup.py", line 294, in run
    GitUp().run()
  File "/usr/bin/gitup.py", line 103, in run
    self.rebase_all_branches()
  File "/usr/bin/gitup.py", line 138, in rebase_all_branches
    if remote.commit.hexsha == branch.commit.hexsha:
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 168, in _get_commit
    obj = self._get_object()
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 161, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 115, in dereference_recursive
    hexsha, ref_path = cls._get_ref_info(repo, ref_path)
  File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 142, in _get_ref_info
    raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/remotes/origin/feature/CA-1572' does not exist

Marvin@marvin-note ~/contaazul (develop)
$ git up
Fetching origin
develop            up to date
master             fast-forwarding...
release/20130620a  rebasing
returning to develop

Marvin@marvin-note ~/contaazul (release/20130620a)
$ 

Any clues? Can I provide more information?

@msiemens
Copy link
Owner

Very strange. Are you running the latest version of PyGitUp? What does pip show git-up tell? In 0.2.3 (where this has been fixed), the line numbers do not match the ones from your stack trace...

@velo
Copy link
Author

velo commented Jun 20, 2013

Hrmmm, 0.1 o0

Marvin@marvin-note ~/contaazul (develop)
$ pip show git-up
---
Name: git-up
Version: 0.1
Location: /usr/lib/python2.7/site-packages
Requires: GitPython, colorama, termcolor

Marvin@marvin-note ~/contaazul (develop)
$ pip install -U git-up
Downloading/unpacking git-up from https://pypi.python.org/packages/source/g/git-up/git-up-0.2.3.zip#md5=192344e9988ae9ece1d16f5bcdd38d4a
  Running setup.py egg_info for package git-up
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)

Requirement already up-to-date: GitPython in /usr/lib/python2.7/site-packages (from git-up)
Requirement already up-to-date: colorama in /usr/lib/python2.7/site-packages (from git-up)
Requirement already up-to-date: termcolor in /usr/lib/python2.7/site-packages (from git-up)
Requirement already up-to-date: gitdb>=0.5.1 in /usr/lib/python2.7/site-packages (from GitPython->git-up)
Requirement already up-to-date: async>=0.6.1 in /usr/lib/python2.7/site-packages (from gitdb>=0.5.1->GitPython->git-up)
Requirement already up-to-date: smmap>=0.8.0 in /usr/lib/python2.7/site-packages (from gitdb>=0.5.1->GitPython->git-up)
Installing collected packages: git-up
  Found existing installation: git-up 0.1
    Uninstalling git-up:
      Successfully uninstalled git-up
  Running setup.py install for git-up
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)

    changing mode of /usr/bin/gitup.py to 775
    Installing git-up script to /usr/bin
Successfully installed git-up
Cleaning up...

Marvin@marvin-note ~/contaazul (develop)
$ pip show git-up
---
Name: git-up
Version: 0.1
Location: /usr/lib/python2.7/site-packages
Requires: GitPython, colorama, termcolor

Marvin@marvin-note ~/contaazul (develop)
$

@msiemens
Copy link
Owner

Seems like this has to do with pypa/pip#709 (pip uses from old build dir).
As a workaround, try finding and removing pip's build dir (/tmp/pip-build-*, ~/.pip, ~/tmp/pip-build-* or similar) and then install git-up again.

@velo
Copy link
Author

velo commented Jun 20, 2013

It worked!

Many thanks!

@msiemens
Copy link
Owner

Does it also fix the problem you mentioned in #3?

@velo
Copy link
Author

velo commented Jun 20, 2013

yeap

@msiemens
Copy link
Owner

Great :)

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

No branches or pull requests

2 participants