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

Re: [PATCH 2/3] added --batch option to mktree

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2009, 08:31 UTC
Message-ID
<7vskj6vkb9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<a644352c0905140217h382a4d18h988b229c12577de3@mail.gmail.com>
Josh Micich <josh.micich@gmail.com> writes:
Show 13 quoted lines
> On Wed, May 13, 2009 at 11:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> This option enables creation of many tree objects with a single process
>>
>>... which is desirable in what way?  how does this justify the cost of
>>maintenance?  what is it used for?
>
> I have been writing a few of my own utilities on top of basic git commands
> and got mild performance gains from using the existing '--batch' option with
> "git cat-file" instead of executing new "git cat-file -p <sha>" processes
> for each object I wish to read.  Later I was writing a utility for mirroring
> another SCM (creates many trees), and I faced a similar performance issue
> with "git mktree".  After adding the '--batch' option, I experienced about a
> 30% speed increase.

"An operation that some people may want to do but the current toolset is not very good at is _this_, and this patch rectifies that. _Here_ is a number to back up that claim." is a perfect way to justify your new feature. Why not have that in the proposed commit log message ;-)?

Show 11 quoted lines
>>> +             if (is_batch_mode && got_eof && used < 1) {
>>> +                     // allow input to finish with a new-line (or not)
>>
>>Style: have an explicit ";" for an empty statement.
>>
>>But more importantly, what does this comment mean?  Why do you want to be
>>loose in input format validation?
>
> I agree with your implied suggestion that tight input validation is better.
> I was actually trying to keep consistent with the way I believe mktree
> works today.  The final \n is optional as far as I can tell.
Ok.
Previous: Josh Micich
Message 16 of 16 in “Proposed patch for mktree [0/3]”
  1. Josh MicichMay 14, 2009
  2. 1/3 '--missing' option for mktree: re-added strbuf_release(&p_uq), Updated man pageJosh Micich, May 14, 2009
  3. Junio C HamanoMay 14, 2009
  4. Josh MicichMay 14, 2009
  5. 2/3 added --batch option to mktreeJosh Micich, May 14, 2009
  6. Junio C HamanoMay 14, 2009
  7. Josh MicichMay 14, 2009
  8. Sverre RabbelierMay 14, 2009
  9. Josh MicichMay 14, 2009
  10. 3/3 improved validation of entry type in mktreeJosh Micich, May 14, 2009
  11. Junio C HamanoMay 14, 2009
  12. Josh MicichMay 14, 2009
  13. Josh MicichMay 14, 2009
  14. Jakub NarebskiMay 15, 2009
  15. Josh MicichMay 15, 2009
  16. Junio C HamanoMay 15, 2009

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.