gitpython

get short sha of commit with gitpython

get short sha of commit with gitpython Question: The long SHA can be gotten like below: repo = git.Repo(search_parent_directories=True) sha = repo.head.object.hexsha Or, in git 3.1.7: sha = repo.head.commit.hexsha How about short one? (short SHA is decided by the scale of the repo, so it should not be like sha[:7]) Asked By: Kentaro Wada || …

Total answers: 6

Is there a python interface to git shortlog?

Is there a python interface to git shortlog? Question: I am trying to get logging information out of git into python. I looked at pygit2 and gitpython, but neither seems to give a high level interface similar to git shortlog. Is there a python library that provides such an interface, or should I just call …

Total answers: 1

How to use git blame in GitPython?

How to use git blame in GitPython? Question: I’m trying to use the GitPython module in my script… and I can’t. That’s not very documented : GitPython Blame I think I’m not so far, because the normally git blame I want to reproduce is the follow : git blame -L127,+1 ../../core/src/filepath.cpp -e Here is my …

Total answers: 2

Using GIT_SSH_COMMAND with GitPython

Using GIT_SSH_COMMAND with GitPython Question: I’m using GitPython to initialize a new local repository, create the initial commit and push to a canonical repository. Unfortunately, the last step is failing and I’m having a lot of trouble understanding why. I’m sure I’m just using the GIT_SSH_COMMAND variable wrong, but I’m not sure how. There aren’t …

Total answers: 1

GitPython and SSH Keys?

GitPython and SSH Keys? Question: How can I use GitPython along with specific SSH Keys? The documentation isn’t very thorough on that subject. The only thing I’ve tried so far is Repo(path). Asked By: andreihondrari || Source Answers: Please note that all of the following will only work in GitPython v0.3.6 or newer. You can …

Total answers: 8

How to get count of unpublished commit with GitPython?

How to get count of unpublished commit with GitPython? Question: With git status I can get information about count of unpublished commits: ยป git status # On branch master # Your branch is ahead of ‘origin/master’ by 2 commits. # (use “git push” to publish your local commits) # nothing to commit, working directory clean …

Total answers: 2