summaryrefslogtreecommitdiff
path: root/vc
blob: 4ad591e2b6f9eb0d4ad3cd5899b0801e96099d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# This is file 'vc' from the vc bundle for TeX.
# The original file can be found at CTAN:support/vc.
# This file is Public Domain.

# Parse command line options.
full=0
mod=0
while [ -n "$(echo $1 | grep '-')" ]; do
    case $1 in
       -f ) full=1 ;;
       -m ) mod=1 ;;
       *  ) echo 'usage: vc [-f] [-m]'
            exit 1
    esac
    shift
done
# English locale.
LC_ALL=C
TZ=UTC git --no-pager log -1 HEAD --pretty=format:"Hash: %H%nAbr. Hash: %h%nParent Hashes: %P%nAbr. Parent Hashes: %p%nAuthor Name: %an%nAuthor Email: %ae%nAuthor Date: %ad%nCommitter Name: %cn%nCommitter Email: %ce%nCommitter Date: %cd%n" --date=iso-local | gawk -v script=log -v full=$full -f vc-git.awk > vc.tex
if [ "$mod" = 1 ]
then
  git status --porcelain |gawk -v script=status -f vc-git.awk >> vc.tex
fi