~miconoco/woo

woo/bin/log -rwxr-xr-x 796 bytes
0b1818b1Christoph Polcin build 3 months ago
                                                                                
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
#!/bin/sh
# log [REF]
#   Changes from last TAG or specific REF

printf "\n"

if [ -n "${1:-}" ]; then
    w0="${1}"
else
    w0="$(git -C "${WOOWS:?WOOWS}" describe --abbrev=0 --tags HEAD^ 2>/dev/null \
        || git -C "${WOOWS:?WOOWS}" log --pretty=format:%h --diff-filter=A -- "manifest" 2>/dev/null)"
fi

ref0=$(git -C "${WOOWS:-WOOWS}" grep --no-color -h \
"^${MOD};" "${w0}:manifest" 2>/dev/null| cut -d';' -f 3)

if [ -z "${ref0}" ]; then
    ref0="$(git rev-list HEAD 2>/dev/null | tail -n 1)"
    [ -z "${ref0}" ] && exit 1
fi

{
    if [ "${ref0}" = "${MREF}" ]; then
        git --no-pager log -1 --oneline --pretty=format:"LATEST: %s" "${ref0}"
    else
        git --no-pager log --oneline --no-merges --pretty=format:%s "${ref0}..HEAD"
    fi
} | uniq | sed 's/^[ +-]*//;s/^/+ /'