aboutsummaryrefslogtreecommitdiff
path: root/Documentation/cmd-list.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-07 01:30:43 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-07 01:30:43 -0700
commitced38ea252cb8b0315f4d2a54648b11c6c090657 (patch)
tree0c398a6bf408bb47fafc65c918b24b1bafeed7b1 /Documentation/cmd-list.perl
parent77e6f5bc1009aa588a3b2235758bf5be13b23d85 (diff)
parentd79073922fcb8c8a0bd57112817a2154f1ed05c1 (diff)
downloadgit-ced38ea252cb8b0315f4d2a54648b11c6c090657.tar.gz
git-ced38ea252cb8b0315f4d2a54648b11c6c090657.tar.xz
Merge branch 'maint'
* maint: Documentation: tighten dependency for git.{html,txt} Makefile: iconv() on Darwin has the old interface t5300-pack-object.sh: portability issue using /usr/bin/stat t3200-branch.sh: small language nit usermanual.txt: some capitalization nits Make builtin-branch.c handle the git config file rename_ref(): only print a warning when config-file update fails Distinguish branches by more than case in tests. Avoid composing too long "References" header. cvsimport: Improve formating consistency cvsimport: Reorder options in documentation for better understanding cvsimport: Improve usage error reporting cvsimport: Improve documentation of CVSROOT and CVS module determination cvsimport: sync usage lines with existing options Conflicts: Documentation/Makefile
Diffstat (limited to 'Documentation/cmd-list.perl')
-rwxr-xr-xDocumentation/cmd-list.perl14
1 files changed, 12 insertions, 2 deletions
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index b54382b2b..0381590d3 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -1,8 +1,11 @@
-#
+#!/usr/bin/perl -w
+
+use File::Compare qw(compare);
sub format_one {
my ($out, $name) = @_;
my ($state, $description);
+ $state = 0;
open I, '<', "$name.txt" or die "No such file $name.txt";
while (<I>) {
if (/^NAME$/) {
@@ -55,7 +58,14 @@ for my $cat (qw(ancillaryinterrogators
format_one(\*O, $_);
}
close O;
- rename "$out+", "$out";
+
+ if (-f "$out" && compare("$out", "$out+") == 0) {
+ unlink "$out+";
+ }
+ else {
+ print STDERR "$out\n";
+ rename "$out+", "$out";
+ }
}
__DATA__