From 6a2456c501093327333b79af9a5fd9cf311702ea Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 27 Nov 2007 15:53:43 -0800 Subject: [PATCH] Don't use git-FOO command to call git sub-commands. --- packaging/nightly-rsync | 6 +++--- packaging/release-rsync | 16 ++++++++-------- support/patch-update | 28 +++++++++++++--------------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/packaging/nightly-rsync b/packaging/nightly-rsync index 03006e5f..da801b1d 100755 --- a/packaging/nightly-rsync +++ b/packaging/nightly-rsync @@ -35,7 +35,7 @@ die "There is no .git dir in the current directory.\n" unless -d '.git'; die "There is no rsync checkout in the current directory.\n" unless -f 'rsyncd.conf.yo'; if ($make_tar) { - open(IN, '-|', 'git-status') or die $!; + open(IN, '-|', 'git status') or die $!; my $status = join('', ); close IN; die "The checkout is not clean:\n", $status unless $status =~ /\nnothing to commit \(working directory clean\)/; @@ -56,9 +56,9 @@ if ($make_tar) { map { s#^#$name/# } @extra_files; print "Creating $name.tar.gz\n"; - system "make gen"; + system 'make gen'; symlink('.', $name); - system "git-archive --format=tar --prefix=$name/ HEAD >$dest/$name.tar"; + system "git archive --format=tar --prefix=$name/ HEAD >$dest/$name.tar"; system "fakeroot tar rf $dest/$name.tar @extra_files; gzip -9 $dest/$name.tar"; unlink($name); unlink($nightly_symlink); diff --git a/packaging/release-rsync b/packaging/release-rsync index f879b89d..30b5f2b6 100755 --- a/packaging/release-rsync +++ b/packaging/release-rsync @@ -43,7 +43,7 @@ die "There is no .git dir in the current directory.\n" unless -d '.git'; die "'a' must not exist in the current directory.\n" if -e 'a'; die "'b' must not exist in the current directory.\n" if -e 'b'; -open(IN, '-|', 'git-status') or die $!; +open(IN, '-|', 'git status') or die $!; my $status = join('', ); close IN; die "The checkout is not clean:\n", $status unless $status =~ /\nnothing to commit \(working directory clean\)/; @@ -161,10 +161,10 @@ foreach my $fn (@tweak_files) { close OUT; } -system "make gen"; +system 'make gen'; print $break; -system "git-diff --color |less -p '^diff .*'"; +system "git diff --color | less -p '^diff .*'"; my $srctar_name = "rsync-$version.tar.gz"; my $pattar_name = "rsync-patches-$version.tar.gz"; @@ -201,8 +201,8 @@ rename("a/configure", "a/configure.sh"); # XXX remove soon system "rsync -a @extra_files rsync-$version/"; -system "git-commit -a -m 'Preparing for release of $version'" and exit 1; -system "git-tag -s -m 'Version $version.' v$version" and exit 1; +system "git commit -a -m 'Preparing for release of $version'" and exit 1; +system "git tag -s -m 'Version $version.' v$version" and exit 1; # When creating a pre-release after a normal release, there's nothing to move. if ($diffdir ne $dest) { @@ -246,13 +246,13 @@ if ($diffdir ne $dest) { print "Creating $srctar_file ...\n"; (my $srctar_tmp = $srctar_file) =~ s/\.gz$//; -system "git-archive --format=tar --prefix=rsync-$version/ v$version >$srctar_tmp"; +system "git archive --format=tar --prefix=rsync-$version/ v$version >$srctar_tmp"; system "fakeroot tar rf $srctar_tmp rsync-$version/*; gzip -9 $srctar_tmp"; print "Creating $diff_file ...\n"; rename("rsync-$version", 'b'); my $sed_script = 's:^((---|\+\+\+) [ab]/[^\t]+)\t.*:\1:'; -system "(git-diff v$lastversion v$version; diff -up a b | sed -r '$sed_script') | gzip -9 >$diff_file"; +system "(git diff v$lastversion v$version; diff -up a b | sed -r '$sed_script') | gzip -9 >$diff_file"; system "rm -rf a b"; system "support/patch-update --gen"; @@ -265,7 +265,7 @@ print "Updating the other files in $dest ...\n"; system "rsync -a README NEWS OLDNEWS TODO $dest"; unlink("$dest/rsync-$version-NEWS"); link("$dest/NEWS", "$dest/rsync-$version-NEWS"); -system "git-log --name-status | gzip -9 >$dest/changelog.gz"; +system "git log --name-status | gzip -9 >$dest/changelog.gz"; system "yodl2html -o $dest/rsync.html rsync.yo"; system "yodl2html -o $dest/rsyncd.conf.html rsyncd.conf.yo"; diff --git a/support/patch-update b/support/patch-update index 15959613..0c0cb6d5 100755 --- a/support/patch-update +++ b/support/patch-update @@ -25,7 +25,7 @@ close IN; my $incl_generated_files = shift if @ARGV && $ARGV[0] eq '--gen'; -system "git-checkout master" and exit 1; +system "git checkout master" and exit 1; if ($incl_generated_files) { die "'a' must not exist in the current directory.\n" if -e 'a'; die "'b' must not exist in the current directory.\n" if -e 'b'; @@ -40,9 +40,9 @@ if (@ARGV) { s{\.diff$} {}; push(@patches, $_); } - open(PIPE, '-|', 'git-branch', '-l') or die $!; + open(PIPE, '-|', 'git', 'branch', '-l') or die $!; } else { - open(PIPE, '-|', 'git-branch', '-a') or die $!; + open(PIPE, '-|', 'git', 'branch', '-a') or die $!; } while () { if (m# origin/patch/(.*)#) { @@ -56,14 +56,11 @@ close PIPE; my(%parent, %description); foreach my $patch (@patches) { my $branch = ($local_patch{$patch} ? '' : 'origin/') . "patch/$patch"; - open(PIPE, '-|', 'git-diff', "master...$branch", '--', "PATCH.$patch") or die $!; - while () { - last if /^@@ /; - } my $desc = ''; + open(PIPE, '-|', 'git', 'diff', '-U1000', "master...$branch", '--', "PATCH.$patch") or die $!; while () { - next if /^-/; # huh?? - s/^.//; + next if m{^\Q+++\E b/PATCH}; + next unless s/^[ +]//; if (m#patch -p1 ', "patches/$patch.diff") or die $!; print OUT $description{$patch}, "\n"; - if (system("git-rebase -m $parent") != 0) { - print qq|"git-rebase -m $parent" incomplete -- please fix.\n|; + if (system("git rebase -m $parent") != 0) { + print qq|"git rebase -m $parent" incomplete -- please fix.\n|; $ENV{PS1} = "[$parent] patch/$patch: "; system $ENV{SHELL} and exit 1; } @@ -125,7 +122,7 @@ sub update_patch } $last_touch = time; - open(PIPE, '-|', 'git-diff', $parent) or die $!; + open(PIPE, '-|', 'git', 'diff', $parent) or die $!; DIFF: while () { while (m{^diff --git a/PATCH}) { while () { @@ -133,6 +130,7 @@ sub update_patch } last DIFF if !defined $_; } + next if /^index /; print OUT $_; } close PIPE; -- 2.34.1