X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/dd1f0da818d33508999298954172f347e4dbf450..7869953bbf3e81972ef3cb18feb97fc8e5c96959:/support/patch-update diff --git a/support/patch-update b/support/patch-update index 502380df..dcfeb6fe 100755 --- a/support/patch-update +++ b/support/patch-update @@ -56,16 +56,9 @@ if ($incl_generated_files) { my $last_touch = time; my(@patches, %local_patch); -if (@ARGV) { - foreach (@ARGV) { - s{^(patches|patch|origin/patch)/} {}; - s{\.diff$} {}; - push(@patches, $_); - } - open(PIPE, '-|', 'git', 'branch', '-l') or die $!; -} else { - open(PIPE, '-|', 'git', 'branch', '-a') or die $!; -} + +# Start by finding all patches so that we can load all possible parents. +open(PIPE, '-|', 'git', 'branch', '-a') or die $!; while () { if (m# origin/patch/(.*)#) { push(@patches, $1); @@ -93,6 +86,16 @@ foreach my $patch (@patches) { $description{$patch} = $desc; } +if (@ARGV) { + # Limit the list of patches to actually process based on @ARGV. + @patches = ( ); + foreach (@ARGV) { + s{^(patches|patch|origin/patch)/} {}; + s{\.diff$} {}; + push(@patches, $_); + } +} + my %completed; foreach my $patch (@patches) { next if $completed{$patch}++; @@ -135,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; }