From: Junio C Hamano <gitster@pobox.com>
To: "Sébastien Guimmara" <sebastien.guimmara@gmail.com>
Cc: git@vger.kernel.org, Luke Diamand <luke@diamand.org>,
Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH v3 2/4] generate-cmdlist.sh: parse common command groups
Date: Sun, 03 May 2015 10:55:10 -0700 [thread overview]
Message-ID: <xmqqpp6hv94x.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <55456A40.80806@gmail.com> ("Sébastien Guimmara"'s message of "Sun, 03 May 2015 02:22:24 +0200")
Sébastien Guimmara <sebastien.guimmara@gmail.com> writes:
> Teach generate-cmdlist.sh to parse common command groups
> found in command-list.txt in the form
>
> common-3_worktree ('3_worktree' being the group identifier)
>
> Extract the $grp variable, in addition to the previous $cmd,
> and inject it as a third field in the cmdname_help struct:
>
> {"add", N_("Add file contents to the index"), "3_worktree"},
>
> So that when 'git' is called, we can display common commands
> grouped by theme instead of a less useful alphabetical order.
>
> Reviewed by: Luke Diamand <luke@diamand.org>
> Reviewed by: Andreas Schwab <schwab@linux-m68k.org>
These people may have helped you to polish your earlier round to
come up with this version, but I do not think they should be listed
as reviewed-by (in the sense that they would say "Yes, I read this
version and consider it very good--I endorse the change!") yet.
> Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com>
> ---
> generate-cmdlist.sh | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
> index 9a4c9b9..98f937b 100755
> --- a/generate-cmdlist.sh
> +++ b/generate-cmdlist.sh
> @@ -4,19 +4,20 @@ echo "/* Automatically generated by $0 */
> struct cmdname_help {
> char name[16];
> char help[80];
> + char group[20];
Storing group name in duplicated text for all commands and then
using string comparison at runtime is grossly wasteful, don't you
think, especially when the list is not manually maintained?
command-list.txt is something manually maintained, i.e. the source,
and it makes sense to use easy-to-see strings like "3_worktree"
label there instead of cryptic number, but the whole point of this
script is to pre-process that text into .c file to a form that is
more suited for machine consumption. I think this script should:
- read command list once to make the list of groups in a new
separate array;
- add the group as an "unsigned char group_number" (as we won't
have more than 200 groups) field to this struct;
- read command list again and for each command give the group
number here.
or something like that.
next prev parent reply other threads:[~2015-05-03 17:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 23:01 [PATCH v2 1/3] git help: group common commands by theme Sébastien Guimmara
2015-05-01 23:06 ` [PATCH v2 2/3] " Sébastien Guimmara
2015-05-02 6:32 ` Luke Diamand
2015-05-02 11:09 ` Sébastien Guimmara
2015-05-02 11:43 ` Andreas Schwab
2015-05-02 11:52 ` Sébastien Guimmara
2015-05-02 14:18 ` Sébastien Guimmara
2015-05-01 23:12 ` [PATCH v2 3/3] " Sébastien Guimmara
2015-05-03 0:19 ` [PATCH v3 0/4] git help: group common commands by themes Sébastien Guimmara
2015-05-03 0:21 ` [PATCH v3 1/4] command-list.txt: " Sébastien Guimmara
2015-05-03 0:22 ` [PATCH v3 2/4] generate-cmdlist.sh: parse common command groups Sébastien Guimmara
2015-05-03 17:55 ` Junio C Hamano [this message]
2015-05-03 20:40 ` Eric Sunshine
2015-05-03 20:53 ` Sébastien Guimmara
2015-05-03 21:10 ` Eric Sunshine
2015-05-03 19:18 ` Eric Sunshine
2015-05-03 20:10 ` Eric Sunshine
2015-05-03 0:23 ` [PATCH v3 3/4] help.c - group common commands by theme Sébastien Guimmara
2015-05-03 19:44 ` Eric Sunshine
2015-05-03 0:24 ` [PATCH v3 4/4] api-builtin.txt: explain common command groups Sébastien Guimmara
2015-05-03 20:02 ` Eric Sunshine
2015-05-03 20:59 ` Sébastien Guimmara
2015-05-03 21:13 ` Eric Sunshine
[not found] ` <CAHYJk3S3s4RjFMUaomP2wUVBbcTLRGYrAOa-uDjrfsKqUuWPog@mail.gmail.com>
2015-05-03 22:32 ` Sébastien Guimmara
2015-05-03 2:23 ` [PATCH v2 1/3] git help: group common commands by theme Junio C Hamano
2015-05-03 13:54 ` Sébastien Guimmara
2015-05-03 13:57 ` Sébastien Guimmara
2015-05-03 17:16 ` 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=xmqqpp6hv94x.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=luke@diamand.org \
--cc=schwab@linux-m68k.org \
--cc=sebastien.guimmara@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.