#!/bin/sh
-# post-checkout hook that changes timestamps on files to that one of the commit
-# if branch was changed
+# post-checkout hook that changes timestamps on known files
+# to that one of the last commit (head) if branch was changed
prev_HEAD="$1"
new_HEAD="$2"
--- /dev/null
+#!/bin/sh
+
+# post-checkout hook that changes timestamps on all files
+# to that one of the last commit (head) if branch was changed
+
+prev_HEAD="$1"
+new_HEAD="$2"
+new_branch="$3"
+
+if [ "$new_branch" = 1 ]; then
+ commit_date="`git show --format='%cD' | head -1`" &&
+ find . \( -name .git -type d -prune \) -o \
+ -exec touch --date="$commit_date" '{}' \+
+fi
+
+exit 0
+++ /dev/null
-#!/bin/sh
-
-# post-checkout hook that changes timestamps on files to that one of the commit
-# if branch was changed
-
-prev_HEAD="$1"
-new_HEAD="$2"
-new_branch="$3"
-
-if [ "$new_branch" = 1 ]; then
- commit_date="`git show --format='%cD' | head -1`" &&
- find . \( -name .git -type d -prune \) -o -exec touch --date="$commit_date" '{}' \+
-fi
-
-exit 0
#! /bin/sh
-# Recursively find commit date/time for every file in the current directory
+# Recursively find commit date/time for every known file in the repository
# and set the file's modification time to that date/time.
git ls-tree -r --name-only HEAD | while read filename; do
--- /dev/null
+#! /bin/sh
+
+# Call set-commit-date on all repositories.
+
+cd "`dirname \"$0\"`" &&
+prog_dir="`pwd`" &&
+
+exec "$prog_dir"/do-all \
+ 'test "$g" = "$d/.git" || continue &&' \
+ 'cd "$d"; echo "$d"; "$prog_dir"/set-commit-date &&' \
+ 'git submodule foreach "$prog_dir"/set-commit-date'
+++ /dev/null
-#! /bin/sh
-
-cd "`dirname \"$0\"`" &&
-prog_dir="`pwd`" &&
-
-exec "$prog_dir"/do-all \
- 'test "$g" = "$d/.git" || continue; cd "$d" &&' \
- 'echo "$d" && "$prog_dir"/touch-all &&' \
- 'git submodule foreach "$prog_dir"/touch-all'