command-list: prepare machinery for upcoming "common groups" section
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 21 May 2015 17:39:18 +0000 (19:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 May 2015 20:03:37 +0000 (13:03 -0700)
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>
Documentation/cmd-list.perl
Makefile
command-list.txt
index 04f99778d81def42e9e129b2f5b2b0551a0c760f..5aa73cfe458d9485510c6a9a67e38e522394b62a 100755 (executable)
@@ -38,6 +38,10 @@ sub format_one {
        }
 }
 
+while (<>) {
+       last if /^### command list/;
+}
+
 my %cmds = ();
 for (sort <>) {
        next if /^#/;
index 5f3987fe3bd945fb5a84c9f45a8de7da5581f79a..a215bee46191c75009be296e75a2dde19265be55 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2447,7 +2447,7 @@ check-docs::
                esac ; \
                test -f "Documentation/$$v.txt" || \
                echo "no doc: $$v"; \
-               sed -e '/^#/d' command-list.txt | \
+               sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \
                grep -q "^$$v[  ]" || \
                case "$$v" in \
                git) ;; \
@@ -2455,7 +2455,8 @@ check-docs::
                esac ; \
        done; \
        ( \
-               sed -e '/^#/d' \
+               sed -e '1,/^### command list/d' \
+                   -e '/^#/d' \
                    -e 's/[     ].*//' \
                    -e 's/^/listed /' command-list.txt; \
                $(MAKE) -C Documentation print-man1 | \
index 54d8d21ad2b0dc43659e0dd7ee64c4cd3a3f8ed9..181a9c291fde4574036cb561aa52591be846e03c 100644 (file)
@@ -1,4 +1,4 @@
-# List of known git commands.
+### command list (do not change this line)
 # command name                          category [deprecated] [common]
 git-add                                 mainporcelain common
 git-am                                  mainporcelain