summaryrefslogtreecommitdiffstats
path: root/unwip
blob: 18d8802b683c8c1af495dc57242ed96ff8b6f3cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/sh

cmd=${0##*/}

if "$cmd" == "wip"
    git add . && git commit -m WIP && git push --force
then
elif "$cmd" == "unwip"
    while [ $(git log --format="%s" HEAD~1..) == "WIP" ]
    do
        git reset --hard HEAD~1
    done
    git pull && git reset --soft HEAD~1 && git reset && git status
else
    echo "unknown cmd '$cmd'" && exit 1
fi