Add an empty root commit to experiment template
[khome.git] / home / bin / x
1 #! /bin/sh
2
3 set -e;
4
5 name=$(echo "$@" | sed 's/\s\+/-/g');
6
7 if [ "$name" != "" ];
8 then
9 timestamp=$(date +'%F--%H-%M-%S');
10 directory="$HOME/x/$timestamp--$name";
11 mkdir -p "$directory";
12 cd "$directory";
13 printf '# %s\n' "$name" > README;
14 git init >&2
15 git commit --allow-empty -m 'Root commit' >&2
16 git add . >&2
17 git commit -m 'Initial commit' >&2
18 echo "$directory";
19 else
20 echo "Please give the experiment a name, as the first argument.";
21 exit 1;
22 fi;
This page took 0.060493 seconds and 4 git commands to generate.