syuji-higa
6/6/2018 - 7:44 AM

batch - Git diff and archive

batch - Git diff and archive

repos={repositorys}
target={target}
output={output}

name=$1
suffix=$2
from=$3
to=$4

repo=${repos}/${name}
zip=${name}-diff-${suffix}

git --git-dir=${repo}/.git --work-tree=${repo} archive --format=zip --prefix=${zip}- --output=${output}/${zip}.zip HEAD `git --git-dir=${repo}/.git --work-tree=${repo} diff --diff-filter=ACMR --name-only ${from}..${to} ${repo}/${target}`