← Back to team overview

dulwich-users team mailing list archive

Re: Fetch a specific revision of a file

 

Perfect, that's exactly what I need. Is there a way to enumerate commits? Or fetch the last X commits?

Regards,
Emile (sent from mobile)

On 17 nov 2009, at 17:44, Jelmer Vernooij <jelmer@xxxxxxxxx> wrote:

Hi Emiliano,

On Tue, 2009-11-17 at 17:16 +0100, Emiliano Heyns wrote:
Is there a way to fetch a specific revision of a file using dulwich?
Do you mean fetching the copy of a file as it existed in a particular
Git commit ?

This is certainly possible for local repositories, you should retrieve
the tree sha associated with the particular commit and then use
tree_path_lookup to find the individual blob.

It's not possible for remote git repositories, because of limitations in
the git network protocol.

Cheers,

jelmer

--
Jelmer Vernooij <jelmer@xxxxxxxxx> - http://samba.org/~jelmer/
Jabber: jelmer@xxxxxxxxxxxxxxx



References