summaryrefslogtreecommitdiffstats
path: root/git/funcs_git.sh
blob: d7f9c2d5247cd17e47f6926d6d67276591db8a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

function git-new-milestone() {
    local module="$1"
    local last="$2"
    local new="$3"

    if [ -z "$module" -o -z "$last" -o -z "$new" ] ; then
        echo "Usage: $0 module last-ref new-ref"
        exit 1
    fi

    mkdir -p ../archive/$new/Sources
    mkdir -p ../archive/$new/ChangeLogs

    echo "Module $module - Tag $new"
#   git archive --format=tar --prefix=$module-$new/ $new | 7z a -si ../archive/$new/Sources/$module-$new.tar.7z
    git archive --format=tar --prefix=$module-$new/ $new | xz -z -9 > ../archive/$new/Sources/$module-$new.tar.xz
#   git archive --format=zip --prefix=$module-$new/ $new -o ../archive/$new/Sources/$module-$new.zip
    git log --no-merges $new ^$last > ../archive/$new/ChangeLogs/$module-ChangeLog-$new.txt
    git shortlog --no-merges $new ^$last > ../archive/$new/ChangeLogs/$module-ShortLog-$new.txt
    git diff --stat --summary -M $last $new > ../archive/$new/ChangeLogs/$module-diffstat-$new.txt
}