Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-23 Thread SZEDER Gábor
> Junio C Hamano writes: > > > Nguyễn Thái Ngọc Duy writes: > > > > > +category_list () { > > > + command_list "$1" | awk '{print $2;}' | sort | uniq > > > +} > > > > Piping output of awk to sort/uniq, instead of processing all inside > > awk within the

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-23 Thread Øystein Walle
Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > > > +category_list () { > > + command_list "$1" | awk '{print $2;}' | sort | uniq > > +} > > Piping output of awk to sort/uniq, instead of processing all inside > awk within the END block of the

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread Junio C Hamano
SZEDER Gábor writes: >> +while read cmd category tags >> do >> - tag=$(echo "$tags" | sed "$substnum; s/[^0-9]//g") >> + name=${cmd/git-} > > There are two issues with this line: > > - This is a "regular" shell script, therefore it must not use pattern >

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread Ramsay Jones
On 16/04/18 16:43, SZEDER Gábor wrote: > On Sun, Apr 15, 2018 at 6:42 PM, Nguyễn Thái Ngọc Duy > wrote: >> common-cmds.h is used to extract the list of common commands (by >> group) and a one-line summary of each command. Some information is >> dropped, for example command

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread Duy Nguyen
On Mon, Apr 16, 2018 at 8:28 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> @@ -23,28 +36,44 @@ sed -n ' >> ' "$1" >> printf '};\n\n' >> >> +echo "#define GROUP_NONE 0xff /* no common group */" > > Some later code forgets about this

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread SZEDER Gábor
On Sun, Apr 15, 2018 at 6:42 PM, Nguyễn Thái Ngọc Duy wrote: > common-cmds.h is used to extract the list of common commands (by > group) and a one-line summary of each command. Some information is > dropped, for example command category or summary of other commands. > Update

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > @@ -23,28 +36,44 @@ sed -n ' > ' "$1" > printf '};\n\n' > > +echo "#define GROUP_NONE 0xff /* no common group */" Some later code forgets about this value, and causes "git" to segfault at the end of this entire series. Namely, here:

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-15 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +category_list () { > + command_list "$1" | awk '{print $2;}' | sort | uniq > +} Piping output of awk to sort/uniq, instead of processing all inside awk within the END block of the script, means that we are wasting two processes---I do not

[PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-15 Thread Nguyễn Thái Ngọc Duy
common-cmds.h is used to extract the list of common commands (by group) and a one-line summary of each command. Some information is dropped, for example command category or summary of other commands. Update generate-cmdlist.sh to keep all the information. The extra info will be used shortly.