Tag: python

How does git-diff generate hunk descriptions?

(git version When I run git diff the output has a nice scope hint after the line numbers for my Python scripts, e.g.: diff –git a/file.py b/file.py index 024f5bb..c3b5c56 100644 — a/file.py +++ b/file.py @@ -14,6 +14,8 @@ TITF: Test Infrastructure Tags Format … @@ -1507,13 +1533,16 @@ class Tags( object ): … Note […]

How to use Google's repo tool on MS Windows OS?

I installed git for windows and it works fine(e.g. use one of the following solutions Want to download a Git repository, what do I need (windows machine)?). I tried to use repo of google but it needs gpg and python 2.7. I installed both and it works fine the only problem is that repo script […]

Commit in git only if tests pass

I’ve recently started using git, and also begun unit testing (using Python’s unittest module). I’d like to run my tests each time I commit, and only commit if they pass. I’m guessing I need to use pre-commit in /hooks, and I’ve managed to make it run the tests, but I can’t seem to find a […]

pulling and integrating remote changes with pygit2

I do have the following problem. I’m writing a script which searches a folder for repositories, looks up the remotes on the net and pulls all new data into the repository, notifying me about new changes. The main idea is clear. I’m using python 2.7 on Windows 7 x64, using pygit2 to access the git […]

Git Bash won't run my python files?

I have been trying to run my python files in Git Bash but I keep getting an error and can’t figure out how to fix it. My command as follows in the git bash executable python filename.py then it says “Bash.exe”: python.exe: command not found I’m a windows user and I have added the path […]

How can I rewrite python __version__ with git?

I would like to define a __version__ variable in my module which should be automatically updated on git commit similarly to what SVN keywords do. Is there a way to achieve it in Git? Does anyone have a working example? I considered using GitPython, but I would not like to introduce another dependency and I […]

Should I be adding the Django migration files in the .gitignore file?

Should I be adding the Django migration files in the .gitignore file? I’ve recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, […]

How can I graph the Lines of Code history for git repo?

Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run wc -l *, and a script that runs git reset –hard on each commit, then runs wc -l To make it a bit clearer, when […]

Checkout/List remote branches in git-python

I don’t see an option to checkout or list remote/local branches in this module http://gitorious.org/git-python/

How can I call 'git pull' from within Python?

Using the github webhooks, I would like to be able to pull any changes to a remote development server. At the moment, when in the appropriate directory, git pull gets any changes that need to be made. However, I can’t figure out how to call that function from within Python. I have tried the following: […]

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