From: Josh Micich <josh.micich@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH 2/3] added --batch option to mktree
Date: Thu, 14 May 2009 02:24:20 -0700 [thread overview]
Message-ID: <a644352c0905140224g41f645c1l734bee791656ea1d@mail.gmail.com> (raw)
In-Reply-To: <7vhbzoxl5k.fsf@alter.siamese.dyndns.org>
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.
If you find this logic persuasive, I can fix all the other issues and
re-submit this patch.
>> +--batch::
>I think you want an blank line before this.
right
>> @@ -125,20 +125,42 @@ int cmd_mktree(int ac, const char **av, const char
>> *prefix)
>
>Linewrapped and would not apply.
sorry - gmane web interface did that. BTW - does git have a coding
standard for maximum line length?
>What do you mean by "interactively"? Does anybody type from the standard
>input?
I guess I was trying to stress the point that the created tree object
ids are output immediately as the complete text for each tree is
received. Other (bad) applications I have seen wait for EOF on stdin
before sending anything to stdout, and this is exactly what I had
avoided in the impl. Perhaps you could suggest better phrasing.
>Decl-after-statement.
>No C++ comment please;
>Lose excess {} pair;
>Style: have an explicit ";" for an empty statement.
>used = 0; /* .... */
sorry - bad habits. gotta work out how to get my compiler to warn me about these
>> + 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.
next prev parent reply other threads:[~2009-05-14 9:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 5:06 Proposed patch for mktree [0/3] Josh Micich
2009-05-14 5:09 ` [PATCH 1/3] '--missing' option for mktree: re-added strbuf_release(&p_uq), Updated man page Josh Micich
2009-05-14 6:04 ` Junio C Hamano
2009-05-14 19:44 ` Josh Micich
2009-05-14 5:10 ` [PATCH 2/3] added --batch option to mktree Josh Micich
2009-05-14 6:18 ` Junio C Hamano
2009-05-14 9:24 ` Josh Micich [this message]
2009-05-14 10:25 ` Sverre Rabbelier
2009-05-14 19:51 ` Josh Micich
[not found] ` <a644352c0905140217h382a4d18h988b229c12577de3@mail.gmail.com>
2009-05-15 8:31 ` Junio C Hamano
2009-05-14 5:11 ` [PATCH 3/3] improved validation of entry type in mktree Josh Micich
2009-05-14 6:24 ` Junio C Hamano
2009-05-14 22:46 ` Josh Micich
2009-05-14 22:49 ` Josh Micich
2009-05-15 6:23 ` Jakub Narebski
2009-05-15 16:57 ` Josh Micich
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a644352c0905140224g41f645c1l734bee791656ea1d@mail.gmail.com \
--to=josh.micich@gmail.com \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).