git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Han-Wen Nienhuys <hanwen@xs4all.nl>
Date
Nov 23, 2007, 00:27 UTC
Message-ID
<fi5743$32p$1@ger.gmane.org>
In-Reply-To
<Pine.LNX.4.64.0711210336210.27959@racer.site>
Johannes Schindelin escreveu:
Show 18 quoted lines
> [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 - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 27 in “Add 'git fast-export', the sister of 'git fast-import'”
  1. Add 'git fast-export', the sister of 'git fast-import'Johannes Schindelin, Nov 21, 2007
  2. Johannes SixtNov 21, 2007
  3. Shawn O. PearceNov 21, 2007
  4. Johannes SchindelinNov 21, 2007
  5. Andreas EricssonNov 21, 2007
  6. Johannes SchindelinNov 21, 2007
  7. Andreas EricssonNov 21, 2007
  8. Geert BoschNov 21, 2007
  9. Johannes SchindelinNov 21, 2007
  10. Han-Wen NienhuysNov 23, 2007
  11. Johannes SchindelinNov 23, 2007
  12. Han-Wen NienhuysNov 23, 2007
  13. Johannes SchindelinNov 23, 2007
  14. Shawn O. PearceNov 23, 2007
  15. Karl HasselströmNov 25, 2007
  16. Johannes SchindelinNov 26, 2007
  17. Karl HasselströmNov 27, 2007
  18. Johannes SchindelinNov 27, 2007
  19. Karl HasselströmNov 27, 2007
  20. Johannes SchindelinNov 27, 2007
  21. Johannes SchindelinNov 26, 2007
  22. Nguyen Thai Ngoc DuyNov 23, 2007
  23. Johannes SchindelinNov 23, 2007
  24. Shawn O. PearceNov 23, 2007
  25. Nguyen Thai Ngoc DuyNov 24, 2007
  26. Johannes SchindelinNov 27, 2007
  27. Nguyen Thai Ngoc DuyNov 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.