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

cmd=${0##*/}

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