generate-cmdlist.sh: do not shell out to "sed"
commit3ebeb1d6b10b538b1c1ca05a260e6ad41ea80fd7
authorJeff King <peff@peff.net>
Fri, 5 Nov 2021 14:08:06 +0000 (5 15:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Nov 2021 19:01:13 +0000 (5 12:01 -0700)
tree2271598a8e8c6a453c8c6f10510412e430f11409
parent8d5be8b421cf525a2fa61cb77921c74be7090c0a
generate-cmdlist.sh: do not shell out to "sed"

Replace the "sed" invocation in get_synopsis() with a pure-shell
version. This speeds up generate-cmdlist.sh significantly. Compared to
HEAD~ (old) and "master" we are, according to hyperfine(1):

  'sh generate-cmdlist.sh command-list.txt' ran
   12.69 ± 5.01 times faster than 'sh generate-cmdlist.sh.old command-list.txt'
   18.34 ± 3.03 times faster than 'sh generate-cmdlist.sh.master command-list.txt'

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
generate-cmdlist.sh