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

Re: [PATCH v3 2/4] generate-cmdlist.sh: parse common command groups

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 3, 2015, 20:10 UTC
Message-ID
<CAPig+cTNzOYjKqM4R9ajAAH6jn1xoDpr=GUz1Guyo3kNjrEviw@mail.gmail.com>
In-Reply-To
<CAPig+cQNOEgZAn=2MXNjkUxnMA+OimTLfSmEMskZsvRv-Zh42w@mail.gmail.com>
On Sun, May 3, 2015 at 3:18 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 26 quoted lines
> On Sat, May 2, 2015 at 8:22 PM, Sébastien Guimmara
> <sebastien.guimmara@gmail.com> wrote:
>> ---
>> 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 */
>>  };
>>   static struct cmdname_help common_cmds[] = {"
>>  -sed -n -e 's/^git-\([^ ]*\)[ ].* common.*/\1/p' [...]
>> +sed -n -e 's/^git-\([^ ]*\)[ ].* common-\(.*\)/\1:\2/p' [...]
>
> Isn't \(.*\) a bit too loose for grabbing $grp? What if someone some
> day adds another column to express some other sort of attribute? (Or,
> if someone perhaps uses the "deprecated" attribute but places it in
> column 3 rather than 2 as documented.) It probably would be better to
> tighten this up by grabbing only non-whitespace characters, as is
> already done for $cmd.
>
> (In fact, this sed invocation is already broken for "deprecated",
> isn't it? According to the command-list.txt header comments,
> "deprecated" should be placed before "common", yet the sed invocation
> expects "common" to follow the command immediately. Perhaps a
> preparatory patch could fix this issue; or just do away with
> "deprecated" entirely since it's not used.)

Ah, I misread the original sed invocation slightly. It's not broken, so scratch the second paragraph.

(Though, it does expect at least one whitespace character and then one space before "common", which is a bit odd, but not a problem with the current content of command-list.txt.)

Previous: Eric SunshineNext: Sébastien Guimmara
Message 17 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.