From aaf5e6eaca4dd60eae83cdf0ade84365b1bfbe2e Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Wed, 6 Jun 2018 15:38:36 +0100 Subject: Change git log command line used for extracting commit hashes Used to use --first-parent but that meant we were missing some commits, so removed it. Unfortunately this slows things down slightly and boosts the space needed for the cache. Also added --no-renames to avoid ugly warning about skipping inexact rename detection. In our use case, we don't particularly care about renames - we're just wanting to know what happened to a file in each commit. --- Perl/Local/VCS_git.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Perl') diff --git a/Perl/Local/VCS_git.pm b/Perl/Local/VCS_git.pm index c11e536af98..a39b8912452 100644 --- a/Perl/Local/VCS_git.pm +++ b/Perl/Local/VCS_git.pm @@ -189,7 +189,7 @@ sub cache_file { _safe_chdir($topdir, $startdir) or die "Can't chdir to $topdir: $!\n"; my (@commits); - open (GITLOG, "git log -p -m --first-parent --name-only --numstat --format=format:\"%H %ct\" -- $file |") or die "Can't fork git log: $!\n"; + open (GITLOG, "git log --no-renames -p -m --name-only --numstat --format=format:\"%H %ct\" -- $file |") or die "Can't fork git log: $!\n"; my ($cmt_date, $cmt_rev); while (my $line = ) { chomp $line; @@ -322,7 +322,7 @@ sub cache_repo { my (@commits); my $count = 0; - open (GITLOG, "git log -p -m --first-parent --name-only --numstat --format=format:\"%H %ct\" |") or die "Can't fork git log: $!\n"; + open (GITLOG, "git log --no-renames -p -m --name-only --numstat --format=format:\"%H %ct\" |") or die "Can't fork git log: $!\n"; my ($cmt_date, $cmt_rev); while (my $line = ) { chomp $line; @@ -693,7 +693,7 @@ sub path_info } } else { # We don't, so we need to talk to git. (2a above) - open (GITLOG, "git log -p -m --first-parent --name-only --numstat --format=format:\"%H %ct\" $dir|") + open (GITLOG, "git log --no-renames -p -m --name-only --numstat --format=format:\"%H %ct\" $dir|") or die "Failed to fork git log: $!\n"; my $cmt_date; my $cmt_rev; -- cgit v1.2.3