about summary refs log tree commit diff
path: root/vcs
blob: 80f831bda8b9fc1d7c526b32922e44689c13e386 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
set -eu
[ -n "${DEBUG:-}" ] && set -x
: "${FORCE:=}"

case "${1:-status}" in

status)
    exec git st
    ;;

commit)
    shift

    # prevent auto-commit of non-web files
    non_web=$(git ls-files -md | grep -vE \
        -e .htm$ \
        -e .html$ \
        -e .md$ \
        -e .jpg$ \
        -e .css$)
    if [ ! $? ] && [ -n "$FORCE" ]; then
        echo not committing non-web files: >&2
        echo "$non_web"
        exit 1
    fi

    git commit --all --trailer=Automated-commit-by:commitall --trailer=signoff --gpg-sign --message=* $*

    echo

    git log --stat --format=full -1

    echo
    ;;

untracked)
    shift
    exec git ls-files -o $*
    ;;

esac