repair: allow status file upgrade
[guilt.git] / guilt-init
blobe895ab49f85149f576e5351b25eedb5a5e4799b0
1 #!/bin/sh
3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 DO_NOT_CHECK_BRANCH_EXISTENCE=1
8 USAGE="[-n]"
9 . `dirname $0`/guilt
11 autotag=1
13 while case $# in 0) break ;; esac; do
14 if [ "$1" = "-n" ]; then
15 autotag=0
16 shift
17 else
18 usage
20 done
22 if [ -d "$GUILT_DIR/$branch" ]; then
23 die "Branch $branch appears to be already initialized (GIT_DIR=$GIT_DIR)"
26 [ ! -d "$GUILT_DIR" ] && mkdir "$GUILT_DIR"
27 mkdir -p "$GUILT_DIR/$branch"
28 touch "$GUILT_DIR/$branch/series"
29 touch "$GUILT_DIR/$branch/status"
31 mkdir -p "$GIT_DIR/hooks/guilt"
32 cat > "$GIT_DIR/hooks/guilt/delete" <<EOF
33 #!/bin/sh
34 # Usage: <script> <patch being removed>
36 echo "Removing patch '\$1'..."
37 EOF
39 git config --int --replace-all guilt.autotag $autotag