Skip to content

Commit 11c6659

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Sébastien Guimmara <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf990a2 commit 11c6659

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Documentation/cmd-list.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ sub format_one {
3838
}
3939
}
4040

41+
while (<>) {
42+
last if /^### command list/;
43+
}
44+
4145
my %cmds = ();
4246
for (sort <>) {
4347
next if /^#/;

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,15 +2447,16 @@ check-docs::
24472447
esac ; \
24482448
test -f "Documentation/$$v.txt" || \
24492449
echo "no doc: $$v"; \
2450-
sed -e '/^#/d' command-list.txt | \
2450+
sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \
24512451
grep -q "^$$v[ ]" || \
24522452
case "$$v" in \
24532453
git) ;; \
24542454
*) echo "no link: $$v";; \
24552455
esac ; \
24562456
done; \
24572457
( \
2458-
sed -e '/^#/d' \
2458+
sed -e '1,/^### command list/d' \
2459+
-e '/^#/d' \
24592460
-e 's/[ ].*//' \
24602461
-e 's/^/listed /' command-list.txt; \
24612462
$(MAKE) -C Documentation print-man1 | \

command-list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# List of known git commands.
1+
### command list (do not change this line)
22
# command name category [deprecated] [common]
33
git-add mainporcelain common
44
git-am mainporcelain

0 commit comments

Comments
 (0)