From: Slavomir Vlcek <svlc@inventati.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] builtin: move builtin retrieval to get_builtin()
Date: Mon, 17 Nov 2014 00:33:40 +0100 [thread overview]
Message-ID: <54693454.1040704@inventati.org> (raw)
In-Reply-To: <xmqq389n2cac.fsf@gitster.dls.corp.google.com>
On 11/13/2014 07:19 PM, Junio C Hamano wrote:
>> git.c | 27 +++++++++++++++------------
>> 1 file changed, 15 insertions(+), 12 deletions(-)
>>
>> diff --git a/git.c b/git.c
>> index 18fbf79..e32c5b8 100644
>> --- a/git.c
>> +++ b/git.c
>> @@ -487,15 +487,20 @@ static struct cmd_struct commands[] = {
>> { "write-tree", cmd_write_tree, RUN_SETUP },
>> };
>>
>> -int is_builtin(const char *s)
>> +struct cmd_struct *get_builtin(const char *s)
>
> I do not think this has to be extern.
>
> static struct cmd_struct *get_builtin(const char *s)
>
> perhaps.
>
>> @@ -519,15 +525,12 @@ static void handle_builtin(int argc, const char **argv)
>> argv[0] = cmd = "help";
>> }
>>
>> - for (i = 0; i < ARRAY_SIZE(commands); i++) {
>> - struct cmd_struct *p = commands+i;
>> - if (strcmp(p->cmd, cmd))
>> - continue;
>> - if (saved_environment && (p->option & NO_SETUP)) {
>> + builtin = get_builtin(cmd);
>
> Nice.
>
>> + if (builtin) {
>> + if (saved_environment && (builtin->option & NO_SETUP))
>> restore_env();
>> - break;
>> - }
>> - exit(run_builtin(p, argc, argv));
>> + else
>> + exit(run_builtin(builtin, argc, argv));
>
> This change does not seem to have anything to do with the topic of
> the change. Why is it necessary?
Does the commit message lack some explanation
or the patch would better be divided into several parts?
I noticed that the patch has been modified (suggested 'static'
scope modification, commit message) and added
to the 'next' branch. So does this mean my task is done
or is there still something I should explain?
Thank you for your corrections.
next prev parent reply other threads:[~2014-11-16 23:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 22:07 [PATCH/RFC] builtin: move builtin retrieval to get_builtin() slavomir vlcek
2014-11-13 0:29 ` [PATCH] SubmittingPatches: fix an inconsistency slavomir vlcek
2014-11-13 18:20 ` Junio C Hamano
2014-11-13 18:28 ` Junio C Hamano
2014-11-13 18:30 ` Junio C Hamano
2014-11-13 21:41 ` slavomir vlcek
2014-11-13 18:19 ` [PATCH/RFC] builtin: move builtin retrieval to get_builtin() Junio C Hamano
2014-11-16 23:33 ` Slavomir Vlcek [this message]
2014-11-17 16:42 ` Junio C Hamano
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=54693454.1040704@inventati.org \
--to=svlc@inventati.org \
--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).