moved os-dependant code into per-os files
[guilt.git] / guilt-init
blobe7f2f6a22f5bf6a4c5657a3244dea6ce82d02fc1
1 #!/bin/sh
3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 DO_NOT_CHECK_BRANCH_EXISTENCE=1
8 USAGE=""
9 . `dirname $0`/guilt
11 while case $# in 0) break ;; esac; do
12 case $1 in
13 -a|-n)
14 echo "Autotagging is no longer supported" >&2
17 usage
19 esac
20 shift
21 done
23 if [ -d "$GUILT_DIR/$branch" ]; then
24 die "Branch $branch appears to be already initialized (GIT_DIR=$GIT_DIR)"
27 [ ! -d "$GUILT_DIR" ] && mkdir "$GUILT_DIR"
28 mkdir -p "$GUILT_DIR/$branch"
29 touch "$GUILT_DIR/$branch/series"
30 touch "$GUILT_DIR/$branch/status"
32 mkdir -p "$GIT_DIR/hooks/guilt"
33 cat > "$GIT_DIR/hooks/guilt/delete" <<EOF
34 #!/bin/sh
35 # Usage: <script> <patch being removed>
37 echo "Removing patch '\$1'..."
38 EOF