git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Schuberth <sschuberth@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] Speed up is_git_command() by checking early for internal commands
Date: Thu, 02 Jan 2014 13:46:22 +0100	[thread overview]
Message-ID: <52C55F9E.5000609@gmail.com> (raw)
In-Reply-To: <CAP8UFD2uq5Q-2F4w2zwH582NTpo9JwiKyHPovQJW+7phbT-b-A@mail.gmail.com>

On 02.01.2014 09:51, Christian Couder wrote:

>> diff --git a/builtin/help.c b/builtin/help.c
>> index b6fc15e..1f0261e 100644
>> --- a/builtin/help.c
>> +++ b/builtin/help.c
>> @@ -284,10 +284,15 @@ static int git_help_config(const char *var, const char *value, void *cb)
>>          return git_default_config(var, value, cb);
>>   }
>>
>> +extern int is_internal_command(const char *s);
>> +
>
> Starting the new year in keeping with the fine tradition of asking
> people who add stuff to clean up what others left behind, I would
> suggest moving all the code related to internal commands (or maybe all
> commands) in a new pair of files like "internal-cmds.{c,h}". This way
> git.c and builtin/help.c could include internal-cmds.h and you
> wouldn't need such extern declaration.

Wouldn't the existing builtin.h be a more appropriate for this? (And 
create a builtin.c for the implementations.)

Also, I start to realize that it's a bit unfortunate that we seem to use 
the terms "builtin" and "internal command" interchangeably. I'll 
probably add a patch to address this.

-- 
Sebastian Schuberth

      reply	other threads:[~2014-01-02 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 21:05 [PATCH 1/2] Call load_command_list() only when it is needed Sebastian Schuberth
2013-12-30 21:07 ` [PATCH 2/2] Speed up is_git_command() by checking early for internal commands Sebastian Schuberth
2014-01-02  8:51   ` Christian Couder
2014-01-02 12:46     ` Sebastian Schuberth [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

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

  git send-email \
    --in-reply-to=52C55F9E.5000609@gmail.com \
    --to=sschuberth@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).