+
+## Parse options
+
+while [ -n "$1" ]; do
+ arg="$1"; shift
+ case "$arg" in
+ -d)
+ basedep="$1"; shift;;
+ -p)
+ branch_prefix="$1"; shift;;
+ -s)
+ single="$1"; shift;;
+ -*)
+ echo "Usage: tg [...] import [-d BASE_BRANCH] {[-p PREFIX] RANGE...|-s NAME COMMIT}" >&2
+ exit 1;;
+ *)
+ ranges="$ranges $arg";;
+ esac
+done
+
+
+## Make sure our tree is clean
+
+git update-index --ignore-submodules --refresh || exit
+[ -z "$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)" ] ||
+ die "the index is not clean"
+
+
+## Perform import
+
+get_commit_msg()