Created
March 15, 2015 20:00
-
-
Save fudanchii/a52a5eb6e5949f7c3083 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env bash | |
| interim_branch=default | |
| rollgit() { | |
| [[ $# -ne 1 ]] && { | |
| echo 'wrong number of arguments, USAGE:' | |
| printf "\tgit roll <branch>\n" | |
| exit 1 | |
| } | |
| git rebase $1 && git co $1 && git rebase $interim_branch && git branch -D $interim_branch | |
| } | |
| unhg() { | |
| [[ $# -ne 2 ]] && { | |
| echo 'wrong number of arguments, USAGE:' | |
| printf "\tgit unhg <remote> <branch>\n" | |
| exit 1 | |
| } | |
| git-hg fetch $1 && git co -b $interim_branch FETCH_HEAD && git roll $2 | |
| } | |
| self=$(basename $0) | |
| case $self in | |
| git-unhg) | |
| unhg $* | |
| ;; | |
| git-roll) | |
| rollgit $* | |
| ;; | |
| *) | |
| echo 'Invalid command specified' | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment