git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] git help: group common commands by theme

From
Andreas Schwab <schwab@linux-m68k.org>
Date
May 2, 2015, 11:43 UTC
Message-ID
<87wq0rb3xk.fsf@igel.home>
In-Reply-To
<CAE5ih78xxHj-YZVnNB=kNw5ZOkT1t2dcc5yjiUWemEQpwFQfDw@mail.gmail.com>
Luke Diamand <luke@diamand.org> writes:
Show 17 quoted lines
>>  };
>>
>>  static struct cmdname_help common_cmds[] = {"
>>
>> -sed -n -e 's/^git-\([^     ]*\)[     ].* common.*/\1/p' command-list.txt |
>> +sed -n -e 's/^git-\([^     ]*\)[     ].* common-\(.*\)/\1:\2/p'
>> command-list.txt |
>>  sort |
>> -while read cmd
>> +while read line
>>  do
>> +     cmd=`echo $line | cut -d ':' -f 1`
>> +     grp=`echo $line | cut -d ':' -f 2`
>
> Should this use $(...) rather than `...` ?
> i.e.
> cmd=$(echo $(line | cut -d : -f 1)
There are various ways to do that without a command substitution, eg:
   cmd=${line%%:*}
   grp=${line#:*}
or:
   IFS=:
   set $line
   cmd=$1 grp=$2
or:
  sort |
  while IFS=: read cmd grp
  do
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Sébastien GuimmaraNext: Sébastien Guimmara
Message 5 of 28 in “git help: group common commands by theme”
  1. 1/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  2. 2/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  3. Luke DiamandMay 2, 2015
  4. Sébastien GuimmaraMay 2, 2015
  5. Andreas SchwabMay 2, 2015
  6. Sébastien GuimmaraMay 2, 2015
  7. Sébastien GuimmaraMay 2, 2015
  8. 3/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  9. 0/4 git help: group common commands by themesSébastien Guimmara, May 3, 2015
  10. 1/4 command-list.txt: group common commands by themesSébastien Guimmara, May 3, 2015
  11. 2/4 generate-cmdlist.sh: parse common command groupsSébastien Guimmara, May 3, 2015
  12. Junio C HamanoMay 3, 2015
  13. Eric SunshineMay 3, 2015
  14. Sébastien GuimmaraMay 3, 2015
  15. Eric SunshineMay 3, 2015
  16. Eric SunshineMay 3, 2015
  17. Eric SunshineMay 3, 2015
  18. 3/4 help.c - group common commands by themeSébastien Guimmara, May 3, 2015
  19. Eric SunshineMay 3, 2015
  20. 4/4 api-builtin.txt: explain common command groupsSébastien Guimmara, May 3, 2015
  21. Eric SunshineMay 3, 2015
  22. Sébastien GuimmaraMay 3, 2015
  23. Eric SunshineMay 3, 2015
  24. Junio C HamanoMay 3, 2015
  25. Sébastien GuimmaraMay 3, 2015
  26. Sébastien GuimmaraMay 3, 2015
  27. Junio C HamanoMay 3, 2015
  28. Sébastien GuimmaraMay 3, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.