From: Joey Hess Date: Mon, 12 Oct 2009 02:39:31 +0000 (-0400) Subject: Merge branch 'master' into dependency-types X-Git-Tag: 3.20091017~27^2~17 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/85af97c9a2311bc6c2606e43aeaf83f7a30e0514?hp=e4c765c64fc31ab13c911b716e80b07b4d1a0037 Merge branch 'master' into dependency-types Conflicts: debian/changelog --- diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index ad58231e0..e10283f59 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -613,9 +613,11 @@ sub rcs_getctime ($) { # Remove srcdir prefix $file =~ s/^\Q$config{srcdir}\E\/?//; - my @sha1s = run_or_non('git', 'rev-list', 'HEAD', '--', $file); - my $ci = git_commit_info($sha1s[$#sha1s], 1); - my $ctime = $ci->{'author_epoch'}; + my @raw_lines = run_or_die('git', 'log', '--reverse', '--follow', + '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c', + '-r', '--', $file); + my $first = parse_diff_tree("", \@raw_lines); + my $ctime = $first->{'author_epoch'}; debug("ctime for '$file': ". localtime($ctime)); return $ctime; diff --git a/debian/changelog b/debian/changelog index 5c47b2524..e9f09a8c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,8 @@ ikiwiki (3.2009XXXX) UNRELEASED; urgency=low month/year. * calendar: Fix bug in next/previous year/month links, which sometimes linked to an archive page from the wrong year, or were missing. + * git: --getctime will now follow renames back to the original creation + of a file. -- Joey Hess Fri, 09 Oct 2009 19:53:50 -0400