]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/cat-texi.perl
make the sender advertise shallow commits to the receiver
[thirdparty/git.git] / Documentation / cat-texi.perl
1 #!/usr/bin/perl -w
2
3 my @menu = ();
4 my $output = $ARGV[0];
5
6 open TMP, '>', "$output.tmp";
7
8 while (<STDIN>) {
9 next if (/^\\input texinfo/../\@node Top/);
10 next if (/^\@bye/ || /^\.ft/);
11 if (s/^\@top (.*)/\@node $1,,,Top/) {
12 push @menu, $1;
13 }
14 s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
15 s/\@anchor\{[^{}]*\}//g;
16 print TMP;
17 }
18 close TMP;
19
20 printf '\input texinfo
21 @setfilename gitman.info
22 @documentencoding UTF-8
23 @dircategory Development
24 @direntry
25 * Git Man Pages: (gitman). Manual pages for Git revision control system
26 @end direntry
27 @node Top,,, (dir)
28 @top Git Manual Pages
29 @documentlanguage en
30 @menu
31 ', $menu[0];
32
33 for (@menu) {
34 print "* ${_}::\n";
35 }
36 print "\@end menu\n";
37 open TMP, '<', "$output.tmp";
38 while (<TMP>) {
39 print;
40 }
41 close TMP;
42 print "\@bye\n";
43 unlink "$output.tmp";