X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/970ce063ee0c17b69ee5343d6934faab479f6ed8..99ba99c74c9d761a502e9d3ed59f1ff72311471f:/support/patch-update diff --git a/support/patch-update b/support/patch-update index a76f111d..e2fe8c93 100755 --- a/support/patch-update +++ b/support/patch-update @@ -27,13 +27,13 @@ if (defined $incl_generated_files) { die "No '$patches_dir' directory was found.\n" unless -d $patches_dir; die "No '.git' directory present in the current dir.\n" unless -d '.git'; +open(IN, '-|', 'git status') or die $!; +my $status = join('', ); +close IN; unless ($skip_branch_check) { - 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\)/; - die "The checkout is not on the master branch.\n" unless $status =~ /^# On branch master\n/; } +my($starting_branch) = $status =~ /^# On branch (.+)\n/; my @extra_files; open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n"; @@ -107,7 +107,7 @@ if ($incl_generated_files) { } sleep 1 if $last_touch == time; -system "git checkout master" and exit 1; +system "git checkout $starting_branch" and exit 1; exit; @@ -138,8 +138,8 @@ sub update_patch open(OUT, '>', "$patches_dir/$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 merge $parent") != 0) { + print qq|"git merge $parent" incomplete -- please fix.\n|; $ENV{PS1} = "[$parent] patch/$patch: "; system $ENV{SHELL} and exit 1; } @@ -185,6 +185,6 @@ sub usage Usage: patch-update [OPTIONS] --gen[=DIR] Include generated files. Optional dest DIR overrides "patches". ---skip-check Skip the check that ensures starting with a clean master branch. +--skip-check Skip the check that ensures starting with a clean branch. EOT }