git-push: add documentation for the newly added --mirror mode
[git/git.git] / Documentation / cmd-list.perl
1 #!/usr/bin/perl -w
2
3 use File::Compare qw(compare);
4
5 sub format_one {
6 my ($out, $name) = @_;
7 my ($state, $description);
8 $state = 0;
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
51 synchingrepositories
52 foreignscminterface
53 purehelpers
54 synchelpers)) {
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;
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 }
69 }
70
71 # The following list is sorted with "sort -d" to make it easier
72 # to find entry in the resulting git.html manual page.
73 __DATA__
74 git-add mainporcelain
75 git-am mainporcelain
76 git-annotate ancillaryinterrogators
77 git-apply plumbingmanipulators
78 git-archimport foreignscminterface
79 git-archive mainporcelain
80 git-bisect mainporcelain
81 git-blame ancillaryinterrogators
82 git-branch mainporcelain
83 git-bundle mainporcelain
84 git-cat-file plumbinginterrogators
85 git-check-attr purehelpers
86 git-checkout mainporcelain
87 git-checkout-index plumbingmanipulators
88 git-check-ref-format purehelpers
89 git-cherry ancillaryinterrogators
90 git-cherry-pick mainporcelain
91 git-citool mainporcelain
92 git-clean mainporcelain
93 git-clone mainporcelain
94 git-commit mainporcelain
95 git-commit-tree plumbingmanipulators
96 git-config ancillarymanipulators
97 git-count-objects ancillaryinterrogators
98 git-cvsexportcommit foreignscminterface
99 git-cvsimport foreignscminterface
100 git-cvsserver foreignscminterface
101 git-daemon synchingrepositories
102 git-describe mainporcelain
103 git-diff mainporcelain
104 git-diff-files plumbinginterrogators
105 git-diff-index plumbinginterrogators
106 git-diff-tree plumbinginterrogators
107 git-fast-import ancillarymanipulators
108 git-fetch mainporcelain
109 git-fetch-pack synchingrepositories
110 git-filter-branch ancillarymanipulators
111 git-fmt-merge-msg purehelpers
112 git-for-each-ref plumbinginterrogators
113 git-format-patch mainporcelain
114 git-fsck ancillaryinterrogators
115 git-gc mainporcelain
116 git-get-tar-commit-id ancillaryinterrogators
117 git-grep mainporcelain
118 git-gui mainporcelain
119 git-hash-object plumbingmanipulators
120 git-http-fetch synchelpers
121 git-http-push synchelpers
122 git-imap-send foreignscminterface
123 git-index-pack plumbingmanipulators
124 git-init mainporcelain
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
131 git-ls-remote plumbinginterrogators
132 git-ls-tree plumbinginterrogators
133 git-mailinfo purehelpers
134 git-mailsplit purehelpers
135 git-merge mainporcelain
136 git-merge-base plumbinginterrogators
137 git-merge-file plumbingmanipulators
138 git-merge-index plumbingmanipulators
139 git-merge-one-file purehelpers
140 git-mergetool ancillarymanipulators
141 git-merge-tree ancillaryinterrogators
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
148 git-pack-refs ancillarymanipulators
149 git-parse-remote synchelpers
150 git-patch-id purehelpers
151 git-peek-remote purehelpers
152 git-prune ancillarymanipulators
153 git-prune-packed plumbingmanipulators
154 git-pull mainporcelain
155 git-push mainporcelain
156 git-quiltimport foreignscminterface
157 git-read-tree plumbingmanipulators
158 git-rebase mainporcelain
159 git-receive-pack synchelpers
160 git-reflog ancillarymanipulators
161 git-relink ancillarymanipulators
162 git-remote ancillarymanipulators
163 git-repack ancillarymanipulators
164 git-request-pull foreignscminterface
165 git-rerere ancillaryinterrogators
166 git-reset mainporcelain
167 git-revert mainporcelain
168 git-rev-list plumbinginterrogators
169 git-rev-parse ancillaryinterrogators
170 git-rm mainporcelain
171 git-runstatus ancillaryinterrogators
172 git-send-email foreignscminterface
173 git-send-pack synchingrepositories
174 git-shell synchelpers
175 git-shortlog mainporcelain
176 git-show mainporcelain
177 git-show-branch ancillaryinterrogators
178 git-show-index plumbinginterrogators
179 git-show-ref plumbinginterrogators
180 git-sh-setup purehelpers
181 git-ssh-fetch synchingrepositories
182 git-ssh-upload synchingrepositories
183 git-stash mainporcelain
184 git-status mainporcelain
185 git-stripspace purehelpers
186 git-submodule mainporcelain
187 git-svn foreignscminterface
188 git-symbolic-ref plumbingmanipulators
189 git-tag mainporcelain
190 git-tar-tree plumbinginterrogators
191 git-unpack-file plumbinginterrogators
192 git-unpack-objects plumbingmanipulators
193 git-update-index plumbingmanipulators
194 git-update-ref plumbingmanipulators
195 git-update-server-info synchingrepositories
196 git-upload-archive synchelpers
197 git-upload-pack synchelpers
198 git-var plumbinginterrogators
199 git-verify-pack plumbinginterrogators
200 git-verify-tag ancillaryinterrogators
201 git-whatchanged ancillaryinterrogators
202 git-write-tree plumbingmanipulators