git unhg
·2 mins
I should tidy up my $HOME/bin directory, some of actually useful scripts and configurations were scattered here and there. Anyway, I’ve been using this one script when I work with shreds:
#! /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 checkout $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 checkout -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 Shreds source revisions is actually tracked on mercurial.