2013-08-28 13:56:10 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
src="${1?Missing source document}"
|
2013-08-28 14:38:09 -04:00
|
|
|
path="${2?Missing spec src path}"
|
2013-08-28 13:56:10 -04:00
|
|
|
|
|
|
|
domake()
|
|
|
|
{
|
|
|
|
pdflatex -draftmode "$src" >&2
|
|
|
|
}
|
|
|
|
|
|
|
|
gendate()
|
|
|
|
{
|
|
|
|
echo -n "$( git log -n1 --pretty=format:%ai | cut -d' ' -f1 ) "
|
|
|
|
}
|
|
|
|
|
|
|
|
domake \
|
|
|
|
&& echo -n 'id ' \
|
|
|
|
&& head -n1 taskstats.dat \
|
|
|
|
&& \
|
|
|
|
(
|
2013-08-28 14:16:49 -04:00
|
|
|
echo -n '0 ' && gendate && tail -n1 taskstats.dat \
|
2013-09-06 15:41:07 -04:00
|
|
|
&& git log --no-merges --pretty=format:'%at %h' -- "$path" \
|
2013-08-28 13:56:10 -04:00
|
|
|
| awk '
|
|
|
|
BEGIN {
|
2013-09-06 15:41:07 -04:00
|
|
|
last=0
|
|
|
|
now=systime()
|
2013-08-28 13:56:10 -04:00
|
|
|
}
|
|
|
|
|
2013-09-06 15:41:07 -04:00
|
|
|
{
|
|
|
|
# calculate the number of days ago this was
|
|
|
|
ago = int( ( now - $1 ) / 86400 );
|
|
|
|
if ( ago <= last ) next;
|
|
|
|
last = ago;
|
|
|
|
print ago, $NF;
|
2013-08-28 13:56:10 -04:00
|
|
|
}
|
|
|
|
' \
|
|
|
|
| while read n h; do
|
|
|
|
git checkout "$h" >&2 \
|
|
|
|
&& domake \
|
2013-08-28 14:16:49 -04:00
|
|
|
&& echo -n "-$n " \
|
2013-08-28 13:56:10 -04:00
|
|
|
&& gendate \
|
|
|
|
&& tail -n1 taskstats.dat \
|
2013-09-05 11:07:14 -04:00
|
|
|
|| { echo "Aborting data gathering."; exit 1; }
|
2013-08-28 13:56:10 -04:00
|
|
|
done
|
2013-08-28 14:16:49 -04:00
|
|
|
)
|