Tag: python

Capturing git log output on Windows XP with Python

This snippet of code works on most Unix I have access to (Linux, Solaris, AIX) as well as on Windows 7/ Server 2008 R2 and up that I’ve used to get the output of git log: from subprocess import Popen, PIPE import platform cmd = [“git”, “–no-pager”] if platform.system() == “Windows”: cmd.append(“–work-tree=/path/to/working/copy”) cmd.extend([“log”, “–pretty=format:\”%cd %h\””, […]

Herkou site looks different at launch then django local server site

My issue is that when I view my site using python manage.py runserver or foreman start, I can see my site perfectly. However, when I git push heroku master on the surface everything appears fine as no errors are given. But when I view my site with the Heroku given site link, I do not […]

sh.exe no such file or directory Python, GitBash

I trying to setup virtualenvwrapper in GitBash (Windows 7), but get an error message “sh.exe”no such file or directory. I wrote in Bash next lines: 1 $ export WORKON_HOME=$HOME/.virtualenvs 2 $ export MSYS_HOME=/c/msys/1.0 3 $ source /usr/local/bin/virtualenvwrapper.sh And the last line give me an error: source /usr/local/bin/virtualenvwrapper.sh sh.exe: /usr/local/bin/virtualenvwrapper.sh: No such file or directory I […]

What is the safest way to modify files in an installed homebrew formula?

I discovered homebrew about a week ago and have been using it to install a number of libraries and modules for Python, one of which being matplotlib. I would like to modify some files in my matplotlib installation as part of a debugging effort, but I know that brew uses some sort of git repository […]

Adding Path in GIT for KIVY

Create a file named ‘py.ini’ and place it either in your users application data directory, or in ‘C:\Windows’. It will contain the path used to start Kivy. I put my Kivy installation at ‘C:\utils\kivy‘ so my copy says: [commands] kivy=”c:\utils\kivy\kivy.bat” (You could also add commands to start other script interpreters, such as jython or IronPython.) […]

Programmatically access git data

How to retrieve file, commit etc. info from bare git repo? When I have created a git server using git init –bare command there are branches/ config description HEAD hooks/ info/ objects/ refs/ created by default. How can I retrieve file list or their content , commit info from server side ? it will be […]

Check Revision of GIT file with Python

Lets say I have a file located at: ‘C:/Users/jdoe/development/git/something/A.txt’ I want to define a Python function that will check if that file is inside of a git repo. If it is not in a git repo, I want the function to return None. If it is in a git repo, I want the function to […]

Equivalent to “git tag –contains” in gitpython

I am trying to achieve git tag –contains <commit> in gitpython. Can anyone point me to the documentation. I have found documentation to fetch all tags but not with tags that contain particular commit.

input inside script with Subprocess.call()

If I run git push origin master, it asks for my Github username and password. How would I put these in with call() like this call([‘git’, ‘push’, ‘origin’, ‘master’])? When I look at the git-push man page, it says nothing about these being arguments.

404 Issue Getting Started in Heroku

When trying to make my first push to Heroku with git push heroku master, I run into a 404 issue installing MySQL-Connector-Python. Any ideas on how I can get around this? Log: —–> Python app detected —–> Installing runtime (python-2.7.8) —–> Installing dependencies with pip Downloading/unpacking CherryPy==3.5.0 (from -r requirements.txt (line 1)) Running setup.py (path:/tmp/pip_build_u52278/CherryPy/setup.py) […]

Git Baby is a git and github fan, let's start git clone.