From 431d07c82a8f4b6ae361d1bdc4e459694a175940 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 6 Feb 2015 23:39:26 +0300 Subject: [PATCH] Add touch-all Recursively find commit date/time for every file in the current directory and set the file's modification time to that date/time. --- touch-all | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 touch-all diff --git a/touch-all b/touch-all new file mode 100755 index 0000000..a4be8c6 --- /dev/null +++ b/touch-all @@ -0,0 +1,8 @@ +#! /bin/sh + +# Recursively find commit date/time for every file in the current directory +# and set the file's modification time to that date/time. + +git ls-tree -r --name-only HEAD | while read filename; do + touch --date="`git log -1 --format="%cD" -- $filename`" "$filename" +done -- 2.39.5