Subject: Re: [WIP PATCH] Add 'git fast-export', the sister of 'git fast-import'

From: Han-Wen Nienhuys <[email-masked]>
Date: Thu, 22 Nov 2007 22:27:46 -0200

Johannes Schindelin escreveu:
> [WIP: this does not handle tags yet, and it lacks a test script
>  as well as documentation.]
> 
> This program dumps (parts of) a git repository in the format that
> fast-import understands.
> 
> For clarity's sake, it does not use the 'inline' method of specifying
> blobs in the commits, but builds the blobs before building the commits.B
> 
> ---
> 	I am way too tired now to continue, but maybe someone else wants
> 	to pick up the ball.
> 
> 	Oh, and it relies on "int" being castable to void * and vice 
> 	versa.  Is anybody aware of a platform where this can lead to
> 	problems?
> 
> 	And yes, I will add a copyright when I woke up again.

This one seems to setup a dump of a single branch from the command
line, which then follows the commit structure.  Am I missing
something?

The cool thing about git-fast-import is that it reads from stdin, has
a very easy to use programmatic interface, and does not impose any
order on how you enter the information.

This doesn't seem to be mirrored by this script? 

I am working on a script for [company] which uses git.  Git is a pain
to script for: for every query I need to invoke another git process,
with another command (log, show-ref, cat-file, show, etc.), parse
another output format and/or specify another --pretty=format:%blah
format.

Besides being a nuisance, I actually run git on NFS, and every git
process has to go to NFS a couple times to retrieve the same
information. This has a noticeable performance impact.

It would make my life a lot easier if I could simply open a pipe to a
single process for the duration of the script, and do all my queries
to this one process.  Of course, if the repository is changed by
another process, I would have to restart it, but that's manageable.  I
could even write a nice Python class that runs both fast-import and
fast-export. I could then have an efficient Python interface to a
git-repository, without needing any library wrapping.

--
 Han-Wen Nienhuys - [email-masked] - http://www.xs4all.nl/~hanwen