From 03bf40d07b0cb4a31f51f7461cd203aff3947306 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 10 Nov 2018 14:28:38 -0500 Subject: remove git-rebase-under now that i've moved away from conf branches, i don't have a need for it anymore --- bin/git/git-rebase-under | 62 ------------------------------------------------ 1 file changed, 62 deletions(-) delete mode 100755 bin/git/git-rebase-under (limited to 'bin') 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 <remove; -- cgit v1.2.3-54-g00ecf