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

Re: [RFC v2] cat-file: add a --stdin-cmd mode

From
EWEric Wong <e@80x24.org>
Date
Jan 28, 2022, 06:07 UTC
Message-ID
<20220128060714.M764085@dcvr>
In-Reply-To
<20220125225008.45944-1-johncai86@gmail.com>
John Cai <johncai86@gmail.com> wrote:
Show 16 quoted lines
> This RFC patch proposes a new flag --stdin-cmd that works with
> git-cat-file --batch. Similar to git-update-ref --stdin, it will accept
> commands and arguments from stdin.
> 
> The start of this idea was discussed in [1], where the original
> motivation was to be able to control when the buffer was flushed to
> stdout in --buffer mode.
> 
> However, this can actually be much more useful in situations when
> git-cat-file --batch is being used as a long lived backend query
> process. At GitLab, we use a pair of cat-file processes. One for
> iterating over object metadata with --batch-check, and the other to grab
> object contents with --batch. However, if we had --stdin-cmd, we could
> get rid of the second --batch-check process, and just have one progress
> where we can flip between getting object info, and getting object contents.
> This can lead to huge savings.

Cool. I wish I had this back when I worked on a project which uses git. In case I ever continue, having 2-3 features in git itself would be useful:

1) ability to add new alternates / object directories on-the-fly
2) ability to deal with unlinked packs
And maybe:
3) ability to remove alternates

I've implemented 1 and 2 via libgit2; but not yet 3 (not really important, atm).

Thanks.
Previous: John Cai
Message 6 of 6 in “[RFC v2] cat-file: add a --stdin-cmd mode”
  1. John CaiJan 25, 2022
  2. John CaiJan 25, 2022
  3. Phillip WoodJan 27, 2022
  4. John CaiJan 27, 2022
  5. John CaiJan 28, 2022
  6. Eric WongJan 28, 2022

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.