7 #echo "git-update-timestamp: '$OS', '$rev', '$pattern'"
10 git rev-list
"$rev" "$1" |
head -n 1
17 if [ "$OS" = 'Linux' ]
19 update_file_timestamp
() {
20 file_time
=`git show --pretty=format:%ai --abbrev-commit "$(get_file_rev "$1")" | head -n 1`
21 touch -d "$file_time" "$1"
22 report
"$1" "$file_time"
24 elif [ "$OS" = 'FreeBSD' ]
26 update_file_timestamp
() {
27 file_time
=`date -r "$(git show --pretty=format:%at --abbrev-commit "$(get_file_rev "$1")" | head -n 1)" '+%Y%m%d%H%M.%S'`
28 touch -h -t "$file_time" "$1"
29 report
"$1" "$file_time"
31 elif [ "$OS" = 'Darwin' ]
33 update_file_timestamp
() {
34 file_time
=`date -j -f '%s' "$(git show --pretty=format:%at --abbrev-commit "$(get_file_rev "$1")" | head -n 1)" '+%Y%m%d%H%M.%S'`
35 #stat -t '%Y%m%d%H%M.%S' -f "stat1: %Sa %Sm %Sc %i %N" "$1"
36 touch -t "$file_time" "$1"
37 report
"$1" "$file_time"
38 #stat -t '%Y%m%d%H%M.%S' -f "stat2: %Sa %Sm %Sc %i %N" "$1"
41 echo "error: timestamp fix not implemented for $OS" >&2
45 for file in `git ls-files "$pattern"`
47 update_file_timestamp
"$file"