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

Re: [PATCH 1/2] cat-file: force flush of stdout on empty string

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 8, 2021, 20:11 UTC
Message-ID
<xmqqk0hitnkc.fsf@gitster.g>
In-Reply-To
<211108.86h7cmfw33.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 18 quoted lines
>> I think overall this approach is cleaner and makes sense. My only
>> question is, are there more commands in the future that will need some
>> special command syntax? Just wondering whether YAGNI applies here.
>
> An obvious addition is to at least add the ability to set the various
> options on the fly, i.e. now you need to use --batch-check, and then
> kill it and restart if you'd like the content with --batch, ditto for
> --textconv.
>
> E.g. the gitaly backend for gitlab.com keeps two cat-filfe processes
> around just to flip-flop between those two, sometimes you want the
> content, sometimes you're just checking if the object exists.
>
> I'd also like to add something to expose the likes of -e and -t
> directly, i.e. even with --batch-check you often want to just check
> existence, but get the size too, you could supply a format, but like the
> above you sometimes want the size or whatever, and killing/starting a
> new process just for that is a hassle...

Yeah, with "plug" and "unplug" instruction you do not have to keep issuing "flush" when you want to go interactive, and other things become easy to do, so even though it would make it a bit more verbose to require "object " prefix for the kind of lines that were historically the only ones accepted by the command, I think it is a good direction to go in.

Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: John Cai via GitGitGadget
Message 7 of 8 in “cat-file: force flush of stdout on empty string”
  1. 0/2 cat-file: force flush of stdout on empty stringJohn Cai via GitGitGadget, Nov 5, 2021
  2. 1/2 cat-file: force flush of stdout on empty stringJohn Cai via GitGitGadget, Nov 5, 2021
  3. Junio C HamanoNov 6, 2021
  4. Ævar Arnfjörð BjarmasonNov 6, 2021
  5. John CaiNov 8, 2021
  6. Ævar Arnfjörð BjarmasonNov 8, 2021
  7. Junio C HamanoNov 8, 2021
  8. 2/2 docs: update behavior of git-cat-file --bufferJohn Cai via GitGitGadget, Nov 5, 2021

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.