A Pythonic git API
The Git represent a git tree
Call a git command
Parameters: |
|
---|
Start a series of git commands
Get a git config value. Return None if not found
Set a new config value. Will be created if it does not exist
Calls git ls-files and returns a list
return the current ref git symbolic-ref HEAD else: git name-rev –name-only –always HEAD
return the current branch
Wrapper for git clone
Update submodule, cloning them if necessary
Get the list of the local branches in a dict master -> tracking branch
Check if the worktree is a valid git tree.
Taken from /usr/lib/git-core/git-sh-setup return a tuple (bool, message) so that you can be more verbose in case the worktree is not clean
Return the output of status or None if it failed.
Returns true if working dir is clean. (i.e. no untracked files, no unstaged changes)
Parameters: | untracked – will return True even if there are untracked files. |
---|
Returns true if there are no commits yet (between git init and git commit
Set a new remote with the given name and url
Update the configuration of a branch to track a given remote branch
Parameters: |
|
---|
git pull –rebase on steroids:
Check local_sha1 is fast-forward with remote_sha1. Return True / False or None in case of error with merge-base.
Return the sha1 from a ref. None if not found.
Make sure master stays compatible with your development branch Checks if your local master branch can be fast-forwarded to remote Update master’s HEAD if it’s the case
Return a list of commits between two refspecs, in natural order (most recent commits last)
Each commit is a dict containing, ‘sha1’ and ‘message’
FIXME: parse author and date ?
Checkout or create the branch next to the matching remote branch.
Return either (True, None) if all went well, or (False, error) in case of error