400.8.125
by Jelmer Vernooij
Add launchpad link. |
1 |
This is the dulwich project. |
2 |
||
3 |
It aims to give an interface to git repos that doesn't call out to git |
|
4 |
directly but instead uses pure Python. |
|
5 |
||
6 |
Open up a repo by passing it the path to the .git dir. You can then ask for |
|
7 |
HEAD with repo.head() or a ref with repo.ref(name). Both return the SHA id |
|
8 |
they currently point to. You can then grab this object with |
|
9 |
repo.get_object(sha). |
|
10 |
||
11 |
For the actual objects the ShaFile.from_file(filename) will return the object |
|
12 |
stored in the file whatever it is. To ensure you get the correct type then |
|
13 |
call {Blob,Tree,Commit}.from_file(filename). I will add repo methods to do |
|
14 |
this for you with file lookup soon. |
|
15 |
||
16 |
There is also support for creating blobs. Blob.from_string(string) will create |
|
17 |
a blob object from the string. You can then call blob.sha() to get the sha |
|
18 |
object for this blob, and hexdigest() on that will get its ID. |
|
19 |
||
20 |
The project is named after the part of London that Mr. and Mrs. Git live in |
|
21 |
in the particular Monty Python sketch. It is based on the Python-Git module |
|
22 |
that James Westby <jw+debian@jameswestby.net> released in 2007 and now |
|
23 |
maintained by Jelmer Vernooij and John Carr. |
|
24 |
||
25 |
Please file bugs in the Dulwich project on Launchpad: |
|
26 |
||
27 |
https://bugs.launchpad.net/dulwich/+filebug |