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

Re: [PATCH] git-svn: make batch mode optional for git-cat-file

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2015, 14:17 UTC
Message-ID
<xmqqlhby5yj3.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<6AE1604EE3EC5F4296C096518C6B77EE5D0FDAB9D8@mail.accesssoftek.com>
Victor Leschuk <vleschuk@accesssoftek.com> writes:
> We already do have some of these: 'no-metadata', 'no-checkout',
> no-auth-cache'. So I was just following the existing convention. Do
> you think we need to change it and stick with
> --catch-file-batch=1/--cat-file-batch=0 ?

Inventing a new --cat-file-batch=[0|1] is not a good idea, and certainly not what I would suggest at all.

My suggestion was to accept --cat-file-batch to allow the --batch processing, and to accept--no-cat-file-batch to trigger your new codepath (and leave --cat-file-batch the default when neither is given). As these option descriptions are eventually passed to Getopt::Long, I thought it should not be too hard to arrange.

Mimicking the existing handling of no-whatever is less bad than accepting --cat-file-batch=[0|1], if you cannot tell the code to take --[no-]cat-file-batch for whatever reason. In the longer term it would need to be cleaned up together with existing ones. Your patch would be adding another instance that needs to be cleaned up to that existing pile, but as long as it follows the same pattern as existing ones, it is easier to spot what needs to be fixed later. Compared to that, accepting --cat-file-batch=[0|1] would be far worse, as such a future clean-up effort can miss it due to its not following the same pattern.

Previous: Victor LeschukNext: Eric Wong
Message 5 of 10 in “git-svn: make batch mode optional for git-cat-file”
  1. git-svn: make batch mode optional for git-cat-fileVictor Leschuk, Sep 21, 2015
  2. Junio C HamanoSep 21, 2015
  3. Victor LeschukSep 21, 2015
  4. Victor LeschukSep 22, 2015
  5. Junio C HamanoSep 22, 2015
  6. Eric WongSep 23, 2015
  7. Eric WongSep 23, 2015
  8. Victor LeschukSep 23, 2015
  9. Eric WongSep 23, 2015
  10. Victor LeschukOct 11, 2015

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.