From 2cd07d308c7a218bba0e321fa59f3d54d5c522ef Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 10 Mar 2014 20:32:10 +0100 Subject: Initial commit --- copydb-current-branch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 copydb-current-branch (limited to 'copydb-current-branch') diff --git a/copydb-current-branch b/copydb-current-branch new file mode 100755 index 0000000..1228941 --- /dev/null +++ b/copydb-current-branch @@ -0,0 +1,28 @@ +#!/usr/bin/zsh +## copydb-current-branch --- Create a copy of a database for the current branch + +## Commentary: + +# Use `copydb' to create a copy of the database named after the +# current branch. This requires the current working directory to be a +# git repository. The name of the database is created by substituting +# all occurrences of `-' with `_'. The database copied from is always +# called `aeos_babel'. The database copied to is called +# `aeos_'. + +# This program is just a wrapper for `copydb', so all information +# related to it is also relevant, please read its comments for more +# info. + +# Usage is: + +# copydb-current-branch + +## Code: + +base="aeos_babel" +branch=$(git branch --no-color | grep '*' | sed -e 's/* //' -e 's/-/_/g') +nbranch="aeos_${branch}" + +echo Copying "$base" to "$nbranch" +copydb "$base" "$nbranch" -- cgit v1.2.3-54-g00ecf