]>
Commit | Line | Data |
---|---|---|
d7907392 JH |
1 | #!/usr/bin/perl -w |
2 | ||
3 | use File::Compare qw(compare); | |
72fe6a59 JH |
4 | |
5 | sub format_one { | |
6 | my ($out, $name) = @_; | |
7 | my ($state, $description); | |
d7907392 | 8 | $state = 0; |
72fe6a59 JH |
9 | open I, '<', "$name.txt" or die "No such file $name.txt"; |
10 | while (<I>) { | |
11 | if (/^NAME$/) { | |
12 | $state = 1; | |
13 | next; | |
14 | } | |
15 | if ($state == 1 && /^----$/) { | |
16 | $state = 2; | |
17 | next; | |
18 | } | |
19 | next if ($state != 2); | |
20 | chomp; | |
21 | $description = $_; | |
22 | last; | |
23 | } | |
24 | close I; | |
25 | if (!defined $description) { | |
26 | die "No description found in $name.txt"; | |
27 | } | |
28 | if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) { | |
29 | print $out "gitlink:$name\[1\]::\n"; | |
30 | print $out "\t$text.\n\n"; | |
31 | } | |
32 | else { | |
33 | die "Description does not match $name: $description"; | |
34 | } | |
35 | } | |
36 | ||
37 | my %cmds = (); | |
38 | while (<DATA>) { | |
39 | next if /^#/; | |
40 | ||
41 | chomp; | |
42 | my ($name, $cat) = /^(\S+)\s+(.*)$/; | |
43 | push @{$cmds{$cat}}, $name; | |
44 | } | |
45 | ||
46 | for my $cat (qw(ancillaryinterrogators | |
47 | ancillarymanipulators | |
48 | mainporcelain | |
49 | plumbinginterrogators | |
50 | plumbingmanipulators | |
89bf2077 JH |
51 | synchingrepositories |
52 | foreignscminterface | |
53 | purehelpers | |
54 | synchelpers)) { | |
72fe6a59 JH |
55 | my $out = "cmds-$cat.txt"; |
56 | open O, '>', "$out+" or die "Cannot open output file $out+"; | |
57 | for (@{$cmds{$cat}}) { | |
58 | format_one(\*O, $_); | |
59 | } | |
60 | close O; | |
d7907392 JH |
61 | |
62 | if (-f "$out" && compare("$out", "$out+") == 0) { | |
63 | unlink "$out+"; | |
64 | } | |
65 | else { | |
66 | print STDERR "$out\n"; | |
67 | rename "$out+", "$out"; | |
68 | } | |
72fe6a59 JH |
69 | } |
70 | ||
aec2196a JH |
71 | # The following list is sorted with "sort -d" to make it easier |
72 | # to find entry in the resulting git.html manual page. | |
72fe6a59 JH |
73 | __DATA__ |
74 | git-add mainporcelain | |
75 | git-am mainporcelain | |
76 | git-annotate ancillaryinterrogators | |
72fe6a59 | 77 | git-apply plumbingmanipulators |
89bf2077 | 78 | git-archimport foreignscminterface |
72fe6a59 JH |
79 | git-archive mainporcelain |
80 | git-bisect mainporcelain | |
81 | git-blame ancillaryinterrogators | |
82 | git-branch mainporcelain | |
2e0afafe | 83 | git-bundle mainporcelain |
72fe6a59 | 84 | git-cat-file plumbinginterrogators |
b568a503 | 85 | git-check-attr purehelpers |
aec2196a JH |
86 | git-checkout mainporcelain |
87 | git-checkout-index plumbingmanipulators | |
89bf2077 | 88 | git-check-ref-format purehelpers |
72fe6a59 JH |
89 | git-cherry ancillaryinterrogators |
90 | git-cherry-pick mainporcelain | |
37cd4f7e | 91 | git-citool mainporcelain |
72fe6a59 JH |
92 | git-clean mainporcelain |
93 | git-clone mainporcelain | |
94 | git-commit mainporcelain | |
95 | git-commit-tree plumbingmanipulators | |
aec2196a | 96 | git-config ancillarymanipulators |
72fe6a59 | 97 | git-count-objects ancillaryinterrogators |
89bf2077 JH |
98 | git-cvsexportcommit foreignscminterface |
99 | git-cvsimport foreignscminterface | |
100 | git-cvsserver foreignscminterface | |
101 | git-daemon synchingrepositories | |
102 | git-describe mainporcelain | |
aec2196a | 103 | git-diff mainporcelain |
72fe6a59 JH |
104 | git-diff-files plumbinginterrogators |
105 | git-diff-index plumbinginterrogators | |
72fe6a59 | 106 | git-diff-tree plumbinginterrogators |
81f915e7 | 107 | git-fast-import ancillarymanipulators |
72fe6a59 JH |
108 | git-fetch mainporcelain |
109 | git-fetch-pack synchingrepositories | |
c401b33c | 110 | git-filter-branch ancillarymanipulators |
89bf2077 | 111 | git-fmt-merge-msg purehelpers |
72fe6a59 JH |
112 | git-for-each-ref plumbinginterrogators |
113 | git-format-patch mainporcelain | |
df391b19 | 114 | git-fsck ancillaryinterrogators |
89bf2077 | 115 | git-gc mainporcelain |
72fe6a59 JH |
116 | git-get-tar-commit-id ancillaryinterrogators |
117 | git-grep mainporcelain | |
37cd4f7e | 118 | git-gui mainporcelain |
72fe6a59 | 119 | git-hash-object plumbingmanipulators |
89bf2077 JH |
120 | git-http-fetch synchelpers |
121 | git-http-push synchelpers | |
122 | git-imap-send foreignscminterface | |
72fe6a59 | 123 | git-index-pack plumbingmanipulators |
89bf2077 | 124 | git-init mainporcelain |
72fe6a59 JH |
125 | git-instaweb ancillaryinterrogators |
126 | gitk mainporcelain | |
127 | git-local-fetch synchingrepositories | |
128 | git-log mainporcelain | |
129 | git-lost-found ancillarymanipulators | |
130 | git-ls-files plumbinginterrogators | |
89bf2077 | 131 | git-ls-remote plumbinginterrogators |
72fe6a59 | 132 | git-ls-tree plumbinginterrogators |
89bf2077 JH |
133 | git-mailinfo purehelpers |
134 | git-mailsplit purehelpers | |
aec2196a | 135 | git-merge mainporcelain |
72fe6a59 JH |
136 | git-merge-base plumbinginterrogators |
137 | git-merge-file plumbingmanipulators | |
138 | git-merge-index plumbingmanipulators | |
89bf2077 | 139 | git-merge-one-file purehelpers |
86952cda | 140 | git-mergetool ancillarymanipulators |
aec2196a | 141 | git-merge-tree ancillaryinterrogators |
72fe6a59 JH |
142 | git-mktag plumbingmanipulators |
143 | git-mktree plumbingmanipulators | |
144 | git-mv mainporcelain | |
145 | git-name-rev plumbinginterrogators | |
146 | git-pack-objects plumbingmanipulators | |
147 | git-pack-redundant plumbinginterrogators | |
89bf2077 JH |
148 | git-pack-refs ancillarymanipulators |
149 | git-parse-remote synchelpers | |
150 | git-patch-id purehelpers | |
151 | git-peek-remote purehelpers | |
72fe6a59 JH |
152 | git-prune ancillarymanipulators |
153 | git-prune-packed plumbingmanipulators | |
154 | git-pull mainporcelain | |
155 | git-push mainporcelain | |
89bf2077 | 156 | git-quiltimport foreignscminterface |
72fe6a59 JH |
157 | git-read-tree plumbingmanipulators |
158 | git-rebase mainporcelain | |
89bf2077 | 159 | git-receive-pack synchelpers |
72fe6a59 JH |
160 | git-reflog ancillarymanipulators |
161 | git-relink ancillarymanipulators | |
727d38d7 | 162 | git-remote ancillarymanipulators |
aec2196a | 163 | git-repack ancillarymanipulators |
89bf2077 JH |
164 | git-request-pull foreignscminterface |
165 | git-rerere ancillaryinterrogators | |
72fe6a59 | 166 | git-reset mainporcelain |
72fe6a59 JH |
167 | git-revert mainporcelain |
168 | git-rev-list plumbinginterrogators | |
169 | git-rev-parse ancillaryinterrogators | |
170 | git-rm mainporcelain | |
171 | git-runstatus ancillaryinterrogators | |
89bf2077 | 172 | git-send-email foreignscminterface |
72fe6a59 | 173 | git-send-pack synchingrepositories |
89bf2077 | 174 | git-shell synchelpers |
72fe6a59 JH |
175 | git-shortlog mainporcelain |
176 | git-show mainporcelain | |
89bf2077 | 177 | git-show-branch ancillaryinterrogators |
72fe6a59 JH |
178 | git-show-index plumbinginterrogators |
179 | git-show-ref plumbinginterrogators | |
89bf2077 | 180 | git-sh-setup purehelpers |
72fe6a59 JH |
181 | git-ssh-fetch synchingrepositories |
182 | git-ssh-upload synchingrepositories | |
09ccdb63 | 183 | git-stash mainporcelain |
72fe6a59 | 184 | git-status mainporcelain |
89bf2077 | 185 | git-stripspace purehelpers |
70c7ac22 | 186 | git-submodule mainporcelain |
89bf2077 | 187 | git-svn foreignscminterface |
89bf2077 JH |
188 | git-symbolic-ref plumbingmanipulators |
189 | git-tag mainporcelain | |
72fe6a59 JH |
190 | git-tar-tree plumbinginterrogators |
191 | git-unpack-file plumbinginterrogators | |
192 | git-unpack-objects plumbingmanipulators | |
193 | git-update-index plumbingmanipulators | |
89bf2077 | 194 | git-update-ref plumbingmanipulators |
72fe6a59 | 195 | git-update-server-info synchingrepositories |
89bf2077 JH |
196 | git-upload-archive synchelpers |
197 | git-upload-pack synchelpers | |
72fe6a59 JH |
198 | git-var plumbinginterrogators |
199 | git-verify-pack plumbinginterrogators | |
89bf2077 JH |
200 | git-verify-tag ancillaryinterrogators |
201 | git-whatchanged ancillaryinterrogators | |
72fe6a59 | 202 | git-write-tree plumbingmanipulators |