diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-10 14:28:38 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-10 14:28:38 -0500 |
commit | 03bf40d07b0cb4a31f51f7461cd203aff3947306 (patch) | |
tree | 8bbb459d8e1ab005e4b8d751c3cfa59b65dd01a2 /bin | |
parent | 30a133e0b2f5a75a0f2350f25773768a71db11b2 (diff) | |
download | conf-03bf40d07b0cb4a31f51f7461cd203aff3947306.tar.gz conf-03bf40d07b0cb4a31f51f7461cd203aff3947306.zip |
remove git-rebase-under
now that i've moved away from conf branches, i don't have a need for it
anymore
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git/git-rebase-under | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/bin/git/git-rebase-under b/bin/git/git-rebase-under deleted file mode 100755 index 7d42584..0000000 --- a/bin/git/git-rebase-under +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.010; - -use Path::Class 'dir'; - -sub git { - if (!defined wantarray) { - system('git', @_); - } - elsif (wantarray) { - chomp(my @ret = qx{git @_}); - return @ret; - } - else { - chomp(my $ret = qx{git @_}); - return $ret; - } -} - -my $git_dir = dir(scalar(git qw(rev-parse --show-toplevel)))->subdir('.git'); -my $state_file = $git_dir->file('rebase-under-state'); - -my ($continuing, $onto, $branch, @commits); -if ($ARGV[0] eq '--continue') { - die "can't continue: no state file" unless -r $state_file; - ($onto, $branch, @commits) = split("\n", $state_file->slurp); - $continuing = 1; -} -else { - $onto = $ARGV[0] // 'master'; - $branch = git qw(symbolic-ref -q HEAD); - $branch =~ s+^refs/heads/++; - - my $remote_branch = "origin/$branch"; - @commits = git 'rev-list', '--reverse', "$remote_branch..$branch"; -} - -$state_file->openw->print(join("\n", $onto, $branch, @commits)); - -if ($continuing) { - git 'commit'; -} -else { - git 'checkout', $onto; -} - -while (@commits) { - my $commit = shift @commits; - $state_file->openw->print(join("\n", $onto, $branch, @commits)); - git 'cherry-pick', $commit; - if ($?) { - die <<DIE; -Conflict detected. Fix the conflict, and run `git rebase-under --continue`. -DIE - } -} -git 'checkout', $branch; -git 'rebase', $onto; - -$state_file->remove; |