git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: John Cai <johncai86@gmail.com>
Cc: git@vger.kernel.org, avarab@gmail.com, me@ttaylorr.com,
	phillip.wood123@gmail.com
Subject: Re: [RFC v2] cat-file: add a --stdin-cmd mode
Date: Fri, 28 Jan 2022 06:07:14 +0000	[thread overview]
Message-ID: <20220128060714.M764085@dcvr> (raw)
In-Reply-To: <20220125225008.45944-1-johncai86@gmail.com>

John Cai <johncai86@gmail.com> wrote:
> 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.

      parent reply	other threads:[~2022-01-28  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 22:50 [RFC v2] cat-file: add a --stdin-cmd mode John Cai
2022-01-25 23:00 ` John Cai
2022-01-27 11:25 ` Phillip Wood
2022-01-27 21:04   ` John Cai
2022-01-28  4:16     ` John Cai
2022-01-28  6:07 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220128060714.M764085@dcvr \
    --to=e@80x24.org \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johncai86@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=phillip.wood123@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).