Merge branch 'master' into dependency-types
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 12 Oct 2009 02:39:31 +0000 (22:39 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 12 Oct 2009 02:39:31 +0000 (22:39 -0400)
Conflicts:
debian/changelog

IkiWiki/Plugin/git.pm
debian/changelog

index ad58231e0bbd897e0f65dec50cc1be451fa3c92a..e10283f59a5889802d218bf8d238301a20866562 100644 (file)
@@ -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;
index 5c47b2524ed9ef695857c58cb826a042baca8cbd..e9f09a8c6958c3d6b204c8cdae4c7af1d4959d00 100644 (file)
@@ -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 <joeyh@debian.org>  Fri, 09 Oct 2009 19:53:50 -0400