From a49c12485985cce469c8b653ff7b76c85343b08d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Feb 2017 23:05:46 +0000 Subject: repobrowse: stop abbreviating commit hashes Abbreviations can become ambiguous over time, and it seems other tools are fine with displaying unabbreviated hashes for commits. This should reduce workload for the search engines, too. --- lib/PublicInbox/RepoGitLog.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/PublicInbox/RepoGitLog.pm') diff --git a/lib/PublicInbox/RepoGitLog.pm b/lib/PublicInbox/RepoGitLog.pm index 4e0997e0..38097ed3 100644 --- a/lib/PublicInbox/RepoGitLog.pm +++ b/lib/PublicInbox/RepoGitLog.pm @@ -10,16 +10,17 @@ use base qw(PublicInbox::RepoBase); use PublicInbox::RepoGit qw(git_dec_links git_commit_title); use PublicInbox::Qspawn; # cannot rely on --date=format-local:... yet, it is too new (September 2015) -use constant STATES => qw(h p D ai an s b); +use constant STATES => qw(H p D ai an s b); use constant STATE_BODY => (scalar(STATES) - 1); my $LOG_FMT = '--pretty=tformat:'. join('%n', map { "%$_" } STATES).'%x00'; sub parent_links { if (@_ == 1) { # typical, single-parent commit - qq( / parent $_[0]); + qq(\n parent $_[0]); } elsif (@_ > 0) { # merge commit - ' / parents ' . - join(' ', map { qq($_) } @_); + "\n parents " . + join("\n ", + map { qq($_) } @_); } else { ''; # root commit } @@ -30,7 +31,7 @@ sub flush_log_hdr ($$$) { my $lpfx = $req->{lpfx}; my $seen = $req->{seen}; $$dst .= '
' if scalar keys %$seen;
-	my $id = $hdr->{h};
+	my $id = $hdr->{H};
 	$seen->{$id} = 1;
 	$$dst .= qq();
@@ -129,9 +130,8 @@ sub call_git_log {
 	my $env = $req->{env};
 	my $git = $repo->{git};
 	my $tip = $req->{-repo}->tip;
-	my $cmd = $git->cmd(qw(log --no-notes --no-color --abbrev-commit),
-				$git->abbrev, $LOG_FMT, "-$max",
-				$tip, '--');
+	my $cmd = $git->cmd(qw(log --no-notes --no-color --no-abbrev),
+				$LOG_FMT, "-$max", $tip, '--');
 	my $rdr = { 2 => $git->err_begin };
 	my $title = "log: $repo->{repo}";
 	if (defined $h) {
-- 
cgit v1.2.3-24-ge0c7