command-list: prepare machinery for upcoming "common groups" section

The ultimate goal is for "git help" to classify common commands by group. Toward this end, a subsequent patch will add a new "common groups" section to command-list.txt preceding the actual command list. As preparation, teach existing command-list.txt parsing machinery, which doesn't care about grouping, to skip over this upcoming "common groups" section. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Sébastien Guimmara <sebastien.guimmara@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed May 21, 2015 at 19:39 UTC 11c6659d85d72273a4161c8779123147b52fbcb2
3 files changed +8 -3
Documentation/cmd-list.perl
+4
@@ -38,6 +38,10 @@ sub format_one {
38 }
39 }
40
41 +while (<>) {
42 + last if /^### command list/;
43 +}
44 +
45 my %cmds = ();
46 for (sort <>) {
47 next if /^#/;
Makefile
+3 -2
@@ -2447,7 +2447,7 @@ check-docs::
2447 esac ; \
2448 test -f "Documentation/$$v.txt" || \
2449 echo "no doc: $$v"; \
2450 - sed -e '/^#/d' command-list.txt | \
2450 + sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \
2451 grep -q "^$$v[ ]" || \
2452 case "$$v" in \
2453 git) ;; \
@@ -2455,7 +2455,8 @@ check-docs::
2455 esac ; \
2456 done; \
2457 ( \
2458 - sed -e '/^#/d' \
2458 + sed -e '1,/^### command list/d' \
2459 + -e '/^#/d' \
2460 -e 's/[ ].*//' \
2461 -e 's/^/listed /' command-list.txt; \
2462 $(MAKE) -C Documentation print-man1 | \
command-list.txt
+1 -1
@@ -1,4 +1,4 @@
1 -# List of known git commands.
1 +### command list (do not change this line)
2 # command name category [deprecated] [common]
3 git-add mainporcelain common
4 git-am mainporcelain