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

git command to read

From
Paul Mackerras <paulus@samba.org>
Date
Oct 21, 2008, 11:21 UTC
Message-ID
<18685.47909.354146.487700@cargo.ozlabs.ibm.com>
Junio,

Is there a command in git at the moment that will read commit IDs on standard input and print the contents of each commit on standard output (without waiting for EOF on stdin)?

I tried git rev-list --stdin --no-walk --header, but it seems to collect all the IDs from stdin and eliminate duplicates before outputting anything, which is not what I want. What I want is a process that I can run from gitk where I can write IDs to its stdin whenever gitk needs to know the contents of some commits, and know that those contents will be turning up on the pipe from its stdout in a timely fashion, without having to start a new process each time. Is there a way to do that currently?

The reason I want this is to reduce gitk's memory usage. At present it reads all the commits into memory, which takes about 160MB on the current kernel tree just to store the contents of all the commits (since Tcl stores strings internally as 2 bytes/character). Instead I plan to make gitk keep a cache of commits and read in commits as needed from an external process. When doing a search, we may need to read in nearly all the commits, and we'll need to do it quickly.

Thanks, Paul.

Next: Jeff King
Message 1 of 4 in “git command to read”
  1. Paul MackerrasOct 21, 2008
  2. Jeff KingOct 21, 2008
  3. Paul MackerrasOct 21, 2008
  4. Alexander GavrilovOct 21, 2008

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.