msiemens / pygitup Goto Github PK
View Code? Open in Web Editor NEWA nicer `git pull`
License: MIT License
A nicer `git pull`
License: MIT License
I Installed git-up as user
$ git-up
`git fetch` failed
Here's what git said:
fatal: No such remote or remote group: .
normal git fetch / git pull works as expected
When installing PyGitUp on Python 3.4.3 i get the following error when showing the version running git up --version
:
Marvin@M:/git/g3-engine (cub3d-version) ?1
[0:18:48] » git up --version
GitUp version is: v1.3.0
Checking for updates...Traceback (most recent call last):
File "C:\Python34\Scripts\git-up-script.py", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "C:\Python34\Scripts\gitup.py", line 580, in run
GitUp(sparse=True).version_info()
File "C:\Python34\Scripts\gitup.py", line 394, in version_info
details = json.load(urlopen(PYPI_URL))
File "C:\Python34\lib\json\__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Python34\lib\json\__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
←[0m%
Also a similar error occurs while fast-forwarding a branch:
Marvin@M:/git/g3-engine (cub3d-version)
[0:19:24] » git up
Fetching epic
Fetching origin
cub3d-version fast-forwarding...
Traceback (most recent call last):
File "C:\Python34\Scripts\git-up-script.py", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "C:\Python34\Scripts\gitup.py", line 590, in run
gitup.run()
File "C:\Python34\Scripts\gitup.py", line 203, in run
self.rebase_all_branches()
File "C:\Python34\Scripts\gitup.py", line 288, in rebase_all_branches
self.log(branch, target)
File "C:\Python34\Scripts\gitup.py", line 355, in log
bat_file.file.write('@echo off\n')
TypeError: 'str' does not support the buffer interface
←[0m%
No problems on python 2.7.9
$ git up
Can't update your repo because it doesn't has any branches with tracking information.
I would love to be able to set something like GIT_UP_TRY_ORIGINMASTER
that would try pulling from origin/master in this case.
When pull
is going to overwrite untracked files git up
will fail with:
error: The following untracked working tree files would be overwritten by checkout
..............
Please move or remove them before you can switch branches.
Aborting
I suggest to move them to a temporary directory after performing stashing and get them back after unstashing so you won't have to do it manually.
I understand that such behavior could be kinda confusing so it may be enabled by a specific command line argument (something like --move-untracked
).
Feature Request :) Supporting multiple remotes would be very handy.
I came up with the following problem upon installation.
C:\Users\Mark Jayson>pip install git-up
Downloading/unpacking git-up
Downloading git-up-1.2.2.zip
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "C:\Python27\lib\site-packages\pip\req.py", line 292, in run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
File "C:\Python27\lib\site-packages\pip\req.py", line 265, in setup_py
import setuptools
File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 12, in <module>
from setuptools.extension import Extension
File "C:\Python27\lib\site-packages\setuptools\extension.py", line 7, in <module>
from setuptools.dist import _get_unpatched
File "C:\Python27\lib\site-packages\setuptools\dist.py", line 15, in <module>
from setuptools.compat import numeric_types, basestring
File "C:\Python27\lib\site-packages\setuptools\compat.py", line 19, in <module>
from SimpleHTTPServer import SimpleHTTPRequestHandler
File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "C:\Python27\lib\SimpleHTTPServer.py", line 208, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Python27\lib\mimetypes.py", line 358, in init
db.read_windows_registry()
File "C:\Python27\lib\mimetypes.py", line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File "C:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0x82 in position 1: ordinal not in range(128)
Storing debug log for failure in C:\Users\Mark Jayson\pip\pip.log
C:\Users\Mark Jayson>
I'm running Python 2.7.6. thoughts?
Whenever this error occurs running git-up:
hotfix-write-process-output-to-console error: remote branch doesn't exist
There is an opportunity to clean up the local branches to reflect similar clean-up performed on the remote. --delete-deleted as an option name seems somewhat reflective of the intent. -d is probably suitable for short.
If -d is specified, a local branch should be deleted if all of the following are true:
Note: This is a heuristic. It is possible to assign an uplink to a branch without ever actually using it. This would mean the remote branch wasn't actually deleted, it was never created to begin with. However, as long as the branch is contained in another branch, it should still be safe to delete the local reference.
Implement aanand/git-up#92 in PyGitUp
@whot published on his blog this absolutely distastefully complicated git alias:
branch-info = "!sh -c 'git branch --list --no-color | \
sed -e \"s/*/ /\" | \
while read branch; do \
git log -1 --format=format:\"%Cred$branch:%Cblue %s %Cgreen%h%Creset (%ar)\" $branch; \
done'"
Yes, it is a way past the moment when it should be split into a separate shell script (and actually Peter apparently got it on his own, and it is now https://github.com/whot/git-branch-tools/blob/master/git-branch-description (if I am not mistaken)), but it still works. However, when I add it to my ~/.gitconfig
git-up
breaks with this traceback:
Traceback (most recent call last):
File "/home/matej/.local/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.2.1', 'console_scripts', 'git-up')()
File "/home/matej/.local/bin/gitup.py", line 572, in run
gitup = GitUp()
File "/home/matej/.local/bin/gitup.py", line 135, in __init__
if not any(b.tracking_branch() for b in self.repo.branches):
File "/home/matej/.local/bin/gitup.py", line 135, in <genexpr>
if not any(b.tracking_branch() for b in self.repo.branches):
File "/home/matej/.local/lib/python2.7/site-packages/git/refs/head.py", line 160, in tracking_branch
if reader.has_option(self.k_config_remote) and reader.has_option(self.k_config_remote_ref):
File "/home/matej/.local/lib/python2.7/site-packages/git/config.py", line 91, in <lambda>
return lambda *args, **kwargs: self._call_config(attr, *args, **kwargs)
File "/home/matej/.local/lib/python2.7/site-packages/git/config.py", line 97, in _call_config
return getattr(self._config, method)(self._section_name, *args, **kwargs)
File "/home/matej/.local/lib/python2.7/site-packages/git/config.py", line 54, in assure_data_present
self.read()
File "/home/matej/.local/lib/python2.7/site-packages/git/config.py", line 294, in read
self._read(fp, fp.name)
File "/home/matej/.local/lib/python2.7/site-packages/git/config.py", line 266, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: /home/matej/.gitconfig
[line 27]: ' sed -e \\"s/*/ /\\" | \\\n'
[line 28]: ' while read branch; do \\\n'
[line 30]: ' done\'"\n'
matej@mitmanek: m2crypto (master)$
I want to run a hook after git up, what should I name the hook in the .git/hooks/ directory? I cannot seem to find any docs on this.
this branch name is feature/#11772-replace-api-url
maybe the name comparing has some bug?
Git-up has stopped working for me with the error:
Traceback (most recent call last):
File "/usr/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 552, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2672, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2351, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/bin/gitup.py", line 66, in <module>
from git import Repo, GitCmdObjectDB
File "/usr/lib/python2.7/site-packages/git/__init__.py", line 37, in <module>
from git.refs import *
File "/usr/lib/python2.7/site-packages/git/refs/__init__.py", line 4, in <module>
from .symbolic import *
File "/usr/lib/python2.7/site-packages/git/refs/symbolic.py", line 11, in <module>
from gitdb.exc import (
ImportError: cannot import name BadName
A quick googling seems to indicate it's an upstream bug in gitpython v.1.0.0 which has been fixed in 1.0.1 (See: gitpython-developers/GitPython#231)
I'm using git up on one of my project with multiple branches. Starting today I got an error whenever using git up. Here's the output of the command run in the shell on a Debian.
$ git up
Fetching origin
develop fast-forwarding...
Traceback (most recent call last):
File "/usr/local/bin/git-up", line 9, in
load_entry_point('git-up==1.1.2', 'console_scripts', 'git-up')()
File "/usr/local/bin/gitup.py", line 558, in run
gitup.run()
File "/usr/local/bin/gitup.py", line 185, in run
self.rebase_all_branches()
File "/usr/local/bin/gitup.py", line 265, in rebase_all_branches
self.git.checkout(branch.name)
File "/usr/local/lib/python2.7/dist-packages/PyGitUp/git_wrapper.py", line 156, in checkout
self.repo.branches, lambda b: b.name == branch_name
File "/usr/local/lib/python2.7/dist-packages/git/refs/head.py", line 218, in checkout
self.repo.git.checkout(self, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 227, in
return lambda args, *kwargs: self.callprocess(name, args, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 456, in callprocess
return self.execute(call, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/git/cmd.py", line 377, in execute
raise GitCommandError(command, status, stderrvalue)
git.exc.GitCommandError: 'git checkout develop' returned exit status 1: error: The following untracked working tree files would be overwritten by checkout:
text/WEB/retrieveAllFiles.sh
Please move or remove them before you can switch branches.
Aborting
I believe I successfully installed PyGitUp:
$ pip install git-up
Collecting git-up
Using cached git-up-1.3.0.zip
Requirement already satisfied (use --upgrade to upgrade): GitPython==1.0.0 in /usr/lib/python2.7/site-packages (from git-up)
Requirement already satisfied (use --upgrade to upgrade): colorama==0.3.3 in /usr/lib/python2.7/site-packages (from git-up)
Requirement already satisfied (use --upgrade to upgrade): termcolor==1.1.0 in /usr/lib/python2.7/site-packages (from git-up)
Requirement already satisfied (use --upgrade to upgrade): docopt==0.6.2 in /usr/lib/python2.7/site-packages (from git-up)
Requirement already satisfied (use --upgrade to upgrade): six==1.9.0 in /usr/lib/python2.7/site-packages (from git-up)
Requirement already satisfied (use --upgrade to upgrade): gitdb>=0.6.4 in /usr/lib/python2.7/site-packages (from GitPython==1.0.0->git-up)
Requirement already satisfied (use --upgrade to upgrade): smmap>=0.8.5 in /usr/lib/python2.7/site-packages (from gitdb>=0.6.4->GitPython==1.0.0->git-up)
Building wheels for collected packages: git-up
Running setup.py bdist_wheel for git-up
Stored in directory: /home/sverhagen/.cache/pip/wheels/19/3b/05/ac8c235883c0b388b9376f8da07d37a5b7f147bf4a9c319002
Successfully built git-up
Installing collected packages: git-up
Successfully installed git-up-1.3.0
I did this using Run As Administrator.
I did all this in Cygwin.
Now it does not work:
$ git up
fatal: 'up' appears to be a git command, but we were not
able to execute it. Maybe git-up is broken?
Do you have any suggestions, thank you!
If I work on my personal feature branch that I periodically rebase on master and force-push into origin, and I accidentally do git up
after rebasing but before force-pushing, the result is weird and confusing: git up rebases local feature on remote feature, which produces rebased copies of all new commits in master.
Maybe it could be possible to try and detect such situation and at least warn that something weird is going on? For example, check if there are local/remote branches that we will be leaving behind after rebase?
Or, I don't know, if that would bring a lot of complications and slow down operation for everyone, while addressing a relatively unusual workflow, oh well, at least if someone else stumbles upon it, they'll see this issue here.
This shell script reproduces the problem:
#!/bin/sh
set -euxo pipefail
rm -rf remote/ local/
git init remote
echo a >> remote/a.txt # this file will be modified on remote
echo b >> remote/b.txt # this file will be modified on local
git -C remote add a.txt b.txt
git -C remote commit -am "0"
echo a >> remote/a.txt
git -C remote commit -am "1"
git clone remote local
git -C local checkout -b feature
echo b >> local/b.txt
git -C local commit -am "feature"
git -C local push --set-upstream origin feature
echo a >> remote/a.txt
git -C remote commit -am "2"
echo a >> remote/a.txt
git -C remote commit -am "3"
echo a >> remote/a.txt
git -C remote commit -am "4"
git -C local up # OK, updates master
git -C local rebase master
git -C local up # rebases local/feature on remote/feature, producing rebased versions of commits 2-3-4
When I call git up --version
, I get :
$ git up --version
GitUp version is: v1.3.0
Checking for updates...Traceback (most recent call last):
File "/usr/local/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "/usr/local/bin/gitup.py", line 579, in run
GitUp(sparse=True).version_info()
File "/usr/local/bin/gitup.py", line 393, in version_info
details = json.load(urlopen(PYPI_URL))
File "/usr/lib/python3.4/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Hello,
I have been experiencing errors with the latest version of PyGitUp (1.4.2) and GitPython (2.1.0) whenever there are conflicts between my local files and the remote. Here's what happens when there is a conflict:
$ git up
Fetching origin
stashing 1 change
Traceback (most recent call last):
File "/home/dev/.pyenv/versions/2.7.9/bin/git-up", line 11, in <module>
sys.exit(run())
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/site-packages/PyGitUp/gitup.py", line 605, in run
gitup.run()
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/site-packages/PyGitUp/gitup.py", line 213, in run
with self.git.stash():
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 147, in stash
self.run('stash')
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 118, in run
raise GitError(message, stderr=error.stderr, stdout=stdout)
File "/home/dev/.pyenv/versions/2.7.9/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 230, in __init__
super(GitError, self).__init__(None, None, stderr)
File "/home/dev/.local/lib/python2.7/site-packages/git/exc.py", line 74, in __init__
super(GitCommandError, self).__init__(command, status, stderr, stdout)
File "/home/dev/.local/lib/python2.7/site-packages/git/exc.py", line 38, in __init__
command = command.split()
AttributeError: 'NoneType' object has no attribute 'split'
Rolling back my installation of GitPython to 2.0.8 fixed the issue. Note that I'm use Python 2.7.9 with PyEnv.
I was in doubt if I should open this issue to GitPython instead, but decided to report it here, to see if other people are experiencing the same problem with git up. If so, maybe you could document it, or add a requirement that GitPython < 2.1.0?
I'm getting the following output on Windows (both in Command Prompt, as well as in Git Bash). Looks like I'm missing something?
F←[0me←[0mt←[0mc←[0mh←[0mi←[0mn←[0mg←[0m ←[0mo←[0mr←[0mi←[0mg←[0mi←[0mn←[0m
←[0m←[0m←[1mdevelop ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mfeature/528 ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mfeature/551 ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mfeature/575 ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mhotfix/545 ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mhotfix/580 ←[0m←[0m ←[0m←[32mup to date←[0m←[0m
←[0mThe system cannot find the path specified.
←[0m
Short: When I run git up
it does not run on my current working directories' git repository.
Long: I have a master repository that has several submodules. To keep everything synced, I run git pull && git submodule foreach pull
(and some more commands). This worked but always caused problems when pushing later. As I understand git up solves this. However, I noticed that git up seems to be running on the master each time in the submodule.
For example, the master module has the branches master
and reduced
while one submodule only has master
and no reduced. However, this is the output produced when running above command (with only one submodule):
Fetching origin
stashing 1 changes
master up to date
reduced up to date
unstashing
Entering 'mysubmodule'
Fetching origin
stashing 1 changes
master up to date
reduced up to date
unstashing
Making things even more weird, when I go into the directory myself and do git up
, the same thing happens:
stashing 1 changes
master up to date
reduced up to date
unstashing
There isn't even a change in this directory, only in the master. I read up on PyGit docs so I ran this: GIT_PYTHON_TRACE=y git up
:
git status --porcelain --untracked-files=no
git config git-up.rebase.auto
git config git-up.rebase.log-hook
git config git-up.bundler.rbenv
git config git-up.bundler.check
git config git-up.bundler.autoinstall
git config git-up.updates.check
git config git-up.fetch.prune
git config git-up.bundler.local
git config git-up.fetch.all
git config git-up.rebase.arguments
git version
git fetch --multiple --prune origin
Fetching origin
git cat-file --batch-check
git diff HEAD --cached --abbrev=40 --full-index --raw
git diff --abbrev=40 --full-index --raw
git status --porcelain --untracked-files=no
stashing 1 changes
git stash
master up to date
reduced up to date
unstashing
git stash pop
It still doesn't say that much about what's really going on though :(
But I executed some of the commands myself and it does behave differently, for example git fetch --multiple --prune origin
did delete a branch on the first run but not on the second, indicating this command was never executed on this repository.
Since I don't know so much about PyGitUp (or PyGit for that matter), I don't know how to debug this efficiently (I am capable of Python though, so I can assist there). I am not sure if I have a major configuration screwup or if this is a bug in PyGitUp but if someone could provide details on how to track this down, I would be very happy.
I know that sounds strange. But if you have a local directory as one of your remotes, the script fails:
Traceback (most recent call last):
File "/Users/audvare/.virtualenvs/zzz/bin/git-up", line 11, in <module>
sys.exit(run())
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/gitup.py", line 600, in run
gitup.run()
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/gitup.py", line 182, in run
self.fetch()
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/gitup.py", line 301, in fetch
self.git.fetch(tostdout=True, *fetch_args, **fetch_kwargs)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 123, in <lambda>
return lambda *args, **kwargs: self.run(name, *args, **kwargs)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 118, in run
raise GitError(message, stderr=error.stderr, stdout=stdout)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 230, in __init__
super(GitError, self).__init__(None, None, stderr)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/git/exc.py", line 74, in __init__
super(GitCommandError, self).__init__(command, status, stderr, stdout)
File "/Users/audvare/.virtualenvs/zzz/lib/python2.7/site-packages/git/exc.py", line 38, in __init__
command = command.split()
AttributeError: 'NoneType' object has no attribute 'split'
To reproduce:
cd $myrepo
git remote add other ~/somewhere/local
git up
Hi,
I found two problems to run PyGitUP.
I have Git Bash version 1.8.4-preview20130916 based on MINGW32 and Windows Python 3.3 installed.
Running git-up in git repo causes:
Traceback (most recent call last):
File "c:\program files (x86)\python33\lib\subprocess.py", line 1106, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\git\cmd.py", line 623, in execute
**subprocess_kwargs
File "c:\program files (x86)\python33\lib\subprocess.py", line 820, in __init__
restore_signals, start_new_session)
File "c:\program files (x86)\python33\lib\subprocess.py", line 1112, in _execute_child
raise WindowsError(*e.args)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files (x86)\python33\lib\runpy.py", line 160, in _run_module_
as_main
"__main__", fname, loader, pkg_name)
File "c:\program files (x86)\python33\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "c:\Users\user\AppData\Roaming\Python\Scripts\git-up.exe\__main__.py", line 9, in <module>
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\PyGitUp\gitup.py", line 599, in run
gitup = GitUp()
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\PyGitUp\gitup.py", line 199, in __init__
self.git.status(porcelain=True, untracked_files='no').split(
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\PyGitUp\git_wrapper.py", line 123, in <lambda>
return lambda *args, **kwargs: self.run(name, *args, **kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\PyGitUp\git_wrapper.py", line 92, in run
cmd = getattr(self.git, name)(as_process=True, *args, **kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\git\cmd.py", line 463, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\git\cmd.py", line 906, in _call_process
return self.execute(make_call(), **_kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python33\site-packages\git\cmd.py", line 626, in execute
raise GitCommandNotFound(str(err))
git.exc.GitCommandNotFound: [WinError 2] The system cannot find the file specified
Exception TypeError: TypeError("'NoneType' object is not iterable",) in <bound method GitWrapper.__del__ of <PyGitUp.git_wrapper.GitWrapper object at 0x0357DCB0>> ignored
I managed to solve it by setting USE_SHELL = True in Python33\site-packages\git\cmd.py
In every place where subprocess is called it is required to use shell.
Could you change it?
Even if I added shell=true, I'm getting (git is on the PATH):
'git' is not recognized as an internal or external command,
operable program or batch file.
It looks like Linux PATH is passed to Windows console, so entire PATH entry is unrecognized.
Echoing PATH confirms it.
Could you also convert Linux PATH to Windows before executing shell command?
BTW. git-up works well under Windows console
I'm getting errors on remotely deleted branches, they don't get removed as expected:
Example:
repo $ git up
Fetching origin
23-1-signup-form error: remote branch doesn't exist
exportimprovements error: remote branch doesn't exist
feature/docker up to date
I'm on git version 2.10.1 on Arch Linux.
I updated to v1.1.0 via
pip install --user -U git-up
and just tried it out in my repo. I got the following:
Traceback (most recent call last):
File "/home/mu/.local/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.1.0', 'console_scripts', 'git-up')()
File "/home/mu/.local/bin/gitup.py", line 552, in run
gitup = GitUp()
File "/home/mu/.local/bin/gitup.py", line 110, in __init__
self.load_config()
File "/home/mu/.local/bin/gitup.py", line 408, in load_config
value = self.config(key)
File "/home/mu/.local/bin/gitup.py", line 423, in config
return self.git.config('git-up.{0}'.format(key))
AttributeError: 'GitUp' object has no attribute 'git'
Am I missing a dependency or so?
quick note: git up --version
(at version 1.3.0) fails with a type error:
git up --version
GitUp version is: v1.3.0
Checking for updates...Traceback (most recent call last):
File "/Users/dbr/.pyenv/versions/3.4.2/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "/Users/dbr/.pyenv/versions/3.4.2/bin/gitup.py", line 579, in run
GitUp(sparse=True).version_info()
File "/Users/dbr/.pyenv/versions/3.4.2/bin/gitup.py", line 393, in version_info
details = json.load(urlopen(PYPI_URL))
File "/Users/dbr/.pyenv/versions/3.4.2/lib/python3.4/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/Users/dbr/.pyenv/versions/3.4.2/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Hello,
I am not 100% sure this is a git up issue (I am relatively new to git and git up).
When I create a git alias to allow me to do a pretty log format:
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
This works and gives me nice output.
When I try to set this log command as rebase log hook in git up:
git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
This doesn't work:
c:\Data\kpn-ritesim>git up
Fetching origin
master fast-forwarding...
Het systeem kan het opgegeven bestand niet vinden.
(This is actually a error message in Dutch, in English it's "File or command not found")
I was supecting it had someting to do with the ' character and I tried different alternatives:
git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:\'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\' --abbrev-commit"
Same result.
git config --global git-up.rebase.log-hook "git log --color --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit"
This command itself cannot be executed (throws the same error).
Since the git alias is working and the git up rebase hook isn't, could it be related to how git up executes the hook?
If I use a simpler git log command, it does work:
git config --global git-up.rebase.log-hook "echo \"changes on $1:\"; git log --oneline --decorate $1..$2"
I am on windows 7 x64.
Valentijn
After upgrading to six 1.10, git up
fails. Does it really need exactly 1.9?
Full stack trace below
git up
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 640, in _build_master
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 941, in require
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 833, in resolve
pkg_resources.ContextualVersionConflict: (six 1.10.0 (/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages), Requirement.parse('six==1.9.0'), {'git-up'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/git-up", line 5, in <module>
from pkg_resources import load_entry_point
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 3141, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 3127, in _call_aside
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 3154, in _initialize_master_working_set
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 642, in _build_master
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 655, in _build_from_requirements
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-20.1.1-py3.5.egg/pkg_resources/__init__.py", line 828, in resolve
pkg_resources.DistributionNotFound: The 'six==1.9.0' distribution was not found and is required by git-up
I believe returning_to_current_branch() is missing its last line, which should read:
print(colored('returning to {0}'.format(branch_name), 'magenta'))
+git.checkout(branch_name)
Hi, I was really hopeful I could get this to install on my Synology NAS DS-214. It has Python and git support.
Looking at the error message it appears to be a problem with 'six-1.7.3' so maybe not related to git-up at all.. just hoping someone might have a suggestion.
Here's what I did and see.
~$ python
Python 2.7.9 (default, Jun 3 2015, 05:41:35)
[GCC 4.6.4] on linux2
~$ python -m pip install git-up
Collecting git-up
Downloading git-up-1.3.0.zip
Collecting GitPython==1.0.0 (from git-up)
Downloading GitPython-1.0.0.tar.gz (354kB)
100% |████████████████████████████████| 356kB 154kB/s
Collecting colorama==0.3.3 (from git-up)
Downloading colorama-0.3.3.tar.gz
Collecting termcolor==1.1.0 (from git-up)
Downloading termcolor-1.1.0.tar.gz
Collecting docopt==0.6.2 (from git-up)
Downloading docopt-0.6.2.tar.gz
Collecting six==1.9.0 (from git-up)
Downloading six-1.9.0-py2.py3-none-any.whl
Collecting gitdb>=0.6.4 (from GitPython==1.0.0->git-up)
Downloading gitdb-0.6.4.tar.gz (400kB)
100% |████████████████████████████████| 401kB 141kB/s
Collecting smmap>=0.8.5 (from gitdb>=0.6.4->GitPython==1.0.0->git-up)
Downloading smmap-0.9.0.tar.gz
Installing collected packages: smmap, gitdb, GitPython, colorama, termcolor, docopt, six, git-up
Running setup.py install for smmap
Running setup.py install for gitdb
Running setup.py install for GitPython
Running setup.py install for colorama
Running setup.py install for termcolor
Running setup.py install for docopt
Found existing installation: six 1.7.3
Uninstalling six-1.7.3:
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 299, in run
root=options.root_path,
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_install.py", line 726, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/__init__.py", line 314, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 300, in move
rmtree(src)
File "/usr/lib/python2.7/shutil.py", line 232, in rmtree
onerror(os.path.islink, path, sys.exc_info())
File "/usr/lib/python2.7/shutil.py", line 230, in rmtree
raise OSError("Cannot call rmtree on a symbolic link")
OSError: Cannot call rmtree on a symbolic link
I installed git up using pip (>sudo pip install git-up)
pip --version
pip 1.5.6 from /usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg (python 2.7)
The following packages are installed
pip list | grep -i git
git-up (1.1.4)
gitdb (0.5.4)
GitPython (0.3.2.RC1)
When I do git up, I see the following:
git up
Fetching origin
dev up to date
Exception AttributeError: "'NoneType' object has no attribute 'debug'" in <bound method ThreadPool.del of <async.pool.ThreadPool object at 0x26c4328>> ignored
This seem to be a general issue since
git up -h
Shows the help and then ends with the same error.
// If OS details are neded
CentOS release 6.5 (Final)
2.6.32-431.23.3.el6.x86_64
The package found here https://pypi.python.org/pypi/git-up or added as a dependency has different source to latest current branch dev. Though versions report the save. Can that be updated?
Using git-up
with no options (1.4.1):
Traceback (most recent call last):
File "/Users/redacted/bin/git-up", line 11, in <module>
sys.exit(run())
File "/Users/redacted/lib/python2.7/site-packages/PyGitUp/gitup.py", line 600, in run
if arguments['--no-fetch'] or arguments['--no-f']:
KeyError: '--no-f'
$ git up --help
No manual entry for git-up
The repository includes tests but unfortunately these are not distributed on a release. Packagers are interested in these files because they're often used to test whether the packaged package actually works. On future releases please include the tests. Thanks!
(NixOS/nixpkgs#15751)
The implementation of git_wrapper.run deadlocks if the subprocess writes a lot of stderr before completing stdout. It's not safe to consume all of stdout before consuming any of stderr; both need to be consumed in parallel.
This is the fix I applied locally:
def run(self, name, *args, **kwargs):
""" Run a git command specified by name and args/kwargs. """
tostdout = kwargs.pop('tostdout', False)
stdout = six.b('')
# Execute command
try:
(status, stdout, stderr) = getattr(self.git, name)(
with_extended_output=True, *args, **kwargs)
sys.stdout.write(stdout.decode('utf-8'))
sys.stdout.flush()
except GitCommandError as error:
# Add more meta-information to errors
message = "'{0}' returned exit status {1}".format(
' '.join(str(c) for c in error.command),
error.status
)
raise GitError(message, stderr=error.stderr, stdout=stdout)
return stdout.strip()
This is a practical problem because "git rebase" can sometimes emit a lot of stderr before emitting any stdout. For example:
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in
Hi,
I have installed PyGitUp on a OS X 10.8.4 and get this when I run it:
Traceback (most recent call last):
File "/usr/local/bin/git-up", line 8, in <module>
load_entry_point('git-up==0.2.3', 'console_scripts', 'git-up')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 318, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2221, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1954, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/bin/gitup.py", line 36, in <module>
from git import Repo, GitCmdObjectDB
ImportError: cannot import name GitCmdObjectDB
What needs to be done to get it to work?
Hi,
I tried to use git up on my machine, but got the following error:
$ git up
0 [main] python2.7 4988 child_info_fork::abort: address space needed by '_ctypes.dll' (0x410000) is already occupied
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 75, in __init__
remote = git.remote_ref_for_branch(branch)
File "/usr/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 132, in remote_ref_for_branch
remote_branch = (self.config('branch.{0}.merge'.format(branch.name)) or
File "/usr/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 183, in config
return self.git.config(key)
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 227, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 456, in _call_process
return self.execute(call, **_kwargs)
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 335, in execute
**subprocess_kwargs
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1143, in _execute_child
self.pid = os.fork()
OSError: [Errno 11] Resource temporarily unavailable
Is there any other information I can provide to help on this?
The way git-up tries to get the path to the repository is not working when the GIT_WORK_TREE and GIT_DIR are different.
get_git_dir()
tries to get the repository with
return execute(['git', 'rev-parse', '--show-toplevel'])
As far as I understand --git-dir
should be used.
(virtualenv)[3/5/2][21:57:14][~/dotfiles]$ git up
Fetching origin
stashing 3 changes
Traceback (most recent call last):
File "/usr/bin/git-up", line 9, in <module>
load_entry_point('git-up==1.3.0', 'console_scripts', 'git-up')()
File "/usr/bin/gitup.py", line 589, in run
gitup.run()
File "/usr/bin/gitup.py", line 200, in run
with self.git.stash():
File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/lib/python2.7/site-packages/PyGitUp/git_wrapper.py", line 146, in stash
self.git.stash()
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 440, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 834, in _call_process
return self.execute(make_call(), **_kwargs)
File "/usr/lib/python2.7/site-packages/git/cmd.py", line 627, in execute
raise GitCommandError(command, status, stderr_value)
git.exc.GitCommandError: 'git stash' returned with exit code 1
stderr: 'zshrc: unmerged (2123e4b31307745a847515a4bcd128d9039e5285)
zshrc: unmerged (6688213d759d0971e4937b7b6ef422cd1d6f6172)
zshrc: unmerged (10370b3e8b0594511f9c7c82d6d00c8ee21ff87c)
fatal: git-write-tree: error building trees
Cannot save the current index state'
(virtualenv)[3/5/2][21:57:17][~/dotfiles][1] $ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: bin-scripts/backtick
# modified: vimrc
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: zshrc
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bin-scripts/pvgf
# vim/.netrwhist
I'm getting a NoSuchPathError when I try to run git up
when I'm currently in a subfolder of my git project.
Sanitized snip here: https://gist.github.com/swhinnem/090510b45817bdc4b6db5c341a8b1d6e
Weird thing to note- the final error at the end lists the subfolder I'm in twice in the path.
I have a situation where I have a master branch, and several feature branches forked off each other. git-up
just quits with a:
Can't update your repo because it doesn't has any remotes.
I would expect it to rebase/merge all my local branches against master.
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
Under windows i don't have git in my PATH by default. Executing git-up in those situations prints
We don't seem to be in a git repository.
although i'm in a repo.
It would be nicer if it was more specific.
The installation instructions are incomplete.
On Ubuntu 14.10:
$ sudo pip install git-up
sudo: pip: command not found
You need to install python-pip first (not installed by default):
sudo apt-get install -y python-pip
This may also pull in some other dependencies.
It would be great if a new release was made with the bugfixes present in master. I intend to package this for Fedora and that would save me from shipping patches.
After upgrading my setuptools package to setuptools 8.0 via pip install --upgrade setuptools
, git up fails to run with the following error:
Traceback (most recent call last):
File "/Users/mike/venv/bin/git-up", line 5, in <module>
from pkg_resources import load_entry_point
File "/Users/mike/venv/lib/python2.7/site-packages/pkg_resources.py", line 2926, in <module>
working_set = WorkingSet._build_master()
File "/Users/mike/venv/lib/python2.7/site-packages/pkg_resources.py", line 553, in _build_master
return cls._build_from_requirements(__requires__)
File "/Users/mike/venv/lib/python2.7/site-packages/pkg_resources.py", line 566, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/Users/mike/venv/lib/python2.7/site-packages/pkg_resources.py", line 745, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: colorama==0.2.4,==0.3.2
Downgrading to setuptools 7.0 lets pygitup work. The release note for setuptools talks about changing the way version numbers are parsed, so you may need to update your requirements.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.