Commit a2cb1823 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

[bug] git-set-file-times: Earlier merge commit prevents from updating timestamp.

Fix was taken from
https://git.wiki.kernel.org/index.php?title=ExampleScripts&action=history
at 17:16, 5 October 2012 (oldid=18471) by Nihen.
parent 6fc611f1
......@@ -12,6 +12,6 @@ Sets mtime and atime of files to the latest commit time in git.
Initially taken from repository of rsync
https://git.samba.org/?p=rsync.git;a=history;f=support/git-set-file-times
at 2009-01-13.
at 2009-01-13, and made modifications.
......@@ -20,12 +20,12 @@ while (<FH>) {
close FH;
$/ = "\n";
open FH, "git log -r --name-only --no-color --pretty=raw -z @ARGV |" or die $!;
open FH, "git log -m -r --name-only --no-color --pretty=raw -z @ARGV |" or die $!;
while (<FH>) {
chomp;
if (/^committer .*? (\d+) (?:[\-\+]\d+)$/) {
$commit_time = $1;
} elsif (s/\0\0commit [a-f0-9]{40}$// or s/\0$//) {
} elsif (s/\0\0commit [a-f0-9]{40}( \(from [a-f0-9]{40}\))?$// or s/\0$//) {
my @files = delete @ls{split(/\0/, $_)};
@files = grep { defined $_ } @files;
next unless @files;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment