-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rather than simply HEAD, for each PDF use the most recent commit contributing to any of that PDF's source files. Add "-dirty" only if the particular PDF's source files are dirty. Use committer date (%cD) rather than author date (%aD) to better reflect when rebased or otherwise amended work appears on master.
- Loading branch information
Showing
4 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# Add "-dirty" only if any of *this* PDF's source files is dirty | ||
test -n "$(git status --porcelain "$@")" && dirty=-dirty | ||
|
||
git rev-list -n1 --format='date %cD' HEAD -- "$@" | while read key value | ||
do | ||
case $key in | ||
commit) | ||
value=$(git describe --always $value) | ||
echo "@newcommand*@commitdesc{$value$dirty}" | ||
;; | ||
date) | ||
# Cut unwanted fields from "[Day, ]DD Mon YYYY[ HH:MM:SS +ZZZZ]" | ||
value=$(echo $value | sed 's/.*, *//;s/ *[0-9]*:.*//') | ||
echo "@newcommand*@headdate{$value}" | ||
;; | ||
esac | ||
done | tr @ \\ |