Questions tagged [dulwich]

Dulwich is a Python implementation of Git.

Dulwich is a Python implementation of Git.

47 questions
60
votes
11 answers

How do I correctly install dulwich to get hg-git working on Windows?

I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed. I followed the instructions on http://hg-git.github.com/ to install the…
Joshua Flanagan
  • 8,527
  • 2
  • 31
  • 40
8
votes
1 answer

Work with GitHub Wiki repository using Python

Is there any way to programmatically (using libraries like PyGithub, GitPython or dulwich) load any file right into MyRepo.wiki.git repository? Using Python, of course. I can easily upload a file right into MyRepo.git repository with a help of…
Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58
6
votes
3 answers

Finding the first commit on a branch with GitPython

I'm writing a git post-receive hook using Python and Git-Python that gathers information about the commits contained in a push, then updates our bug tracker and IM with a summary. I'm having trouble in the case where a push creates a branch (i.e.…
Julian Melville
  • 185
  • 2
  • 9
6
votes
3 answers

How to get a list of tags and create new tags with python and dulwich in git?

I am having problems to retrieve the following information of a git repo using python: I would like to get a list of all tags of this repository. I would like to checkout another branch and also create a new branch for staging. I would like to tag…
GorillaPatch
  • 5,007
  • 1
  • 39
  • 56
6
votes
2 answers

How to pull from the remote using dulwich?

How to do something like git pull in python dulwich library.
Determinant
  • 3,886
  • 7
  • 31
  • 47
5
votes
4 answers

Programmatically `git checkout .` with dulwich

Having this code from dulwich.objects import Blob, Tree, Commit, parse_timezone from dulwich.repo import Repo from time import time repo = Repo.init("myrepo", mkdir=True) blob = Blob.from_string("my file content\n") tree = Tree() tree.add("spam",…
Flavius
  • 13,566
  • 13
  • 80
  • 126
4
votes
1 answer

In Dulwich, how do I commit to a branch instead of to HEAD?

Apparently repo.do_commit(message='test commit', committer='Name ') only commits to refs/heads/master. Is there a way to set the current commit ref to another one than refs/heads/master? Or is the only way to commit to a branch by creating a Commit…
Daniel F
  • 13,684
  • 11
  • 87
  • 116
4
votes
0 answers

I pip install a specific package with --global-option. How do I add that package as a dependency in setup.py?

I'm using this package called Dulwich. While developing, I install it like this: pip install dulwich --global-option="--pure" I want to add dulwich as a dependency to the setup.py file for my own package, but i'm not sure how to get it to use that…
user3715648
  • 1,498
  • 3
  • 16
  • 25
4
votes
2 answers

dulwich - clone from remote repo authentication

I couldn't find any resource on this topic. I need to clone from a private repository by providing the username and the password. However when they are provided as keyword arguments to 'dulwich.get-client-from-path()' an error occurs saying 'unknown…
chamilad
  • 1,619
  • 3
  • 23
  • 40
4
votes
3 answers

How to get last commit for specified file with python(dulwich)?

I need author name and last commit time for a specified file with python. Currentrly, I'm trying to use dulwich. There're plenty of apis to retrieve objects for a specific SHA like: repo = Repo("myrepo") head = repo.head() object =…
ccoroom
  • 699
  • 9
  • 23
3
votes
2 answers

Getting started with Git Python

My goal is to access existing Git repos from Python. I want to get repo history and on demand diffs. In order to do that I started with dulwich. So I tried: from dulwich.repo import Repo Repo.init('/home/umpirsky/Projects/my-exising-git-repo') and…
umpirsky
  • 9,902
  • 13
  • 71
  • 96
3
votes
2 answers

How to add something to the index, commit it, then push the master branch to a named remote with dulwich?

How can I add something to the index, as in git add . then git commit -m "message" then git push origin master using dulwich? So far I've found this http://www.samba.org/~jelmer/dulwich/apidocs/dulwich.index.Index.html but it doesn't say much,…
Flavius
  • 13,566
  • 13
  • 80
  • 126
3
votes
1 answer

Do the git repository data structures use a canonical encoding?

I'm using dulwich (a Python library) to access a git repository. When I use get_object to retrieve a commit, it has a number of attributes. One of those is author. When I retrieve this attribute, I get bytes and so the attribute is an an unknown…
Omnifarious
  • 54,333
  • 19
  • 131
  • 194
3
votes
1 answer

Hg Git Pull Causes Too Many Open Files Error

I have a Mercurial repository that tracks a git repository. It was working ok on Windows 10. Now I moved it to a Mac as a directory, then ran hg reset -Ca just to clean it up. Now I am trying to run hg pull It causes an error like this: % hg…
EvgeniySharapov
  • 3,078
  • 3
  • 27
  • 38
3
votes
1 answer

"git push origin master " in Dulwich

I am new to git and python and I was trying to do : git push origin master using Dulwich I have cloned a remote repository to local repo "local_repo" and then trying to do something…
Keats
  • 53
  • 3
1
2 3 4