Last active
November 15, 2019 16:02
-
-
Save michaeleisel/a0a6b7aaff2e977d92f6cff4259fb2d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
def try(cmd) | |
puts cmd | |
success = system(cmd) | |
raise unless success | |
end | |
def current_commit() | |
`git rev-parse head`.chomp | |
end | |
old_commit = ARGV[0] | |
raise "missing commit" unless old_commit | |
tip = current_commit() | |
try("git add --all && git checkout #{old_commit} && git commit --amend --no-edit") | |
new_commit = current_commit() | |
try("./tools/phabify && git checkout - && git rebase --onto #{new_commit} #{old_commit}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment