From 8ceeea662e01a65951d5d07fc9993087242d6206 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Jan 2016 03:21:06 +0000 Subject: honor core.abbrev from git-config(1) We will use core.abbrev=12 by default if unset, as the git default of 7 is too low for long-term usability of links. Some of our callers used 16, which was probably excessive. --- lib/PublicInbox/Git.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index ac556426..23a3e6c7 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -13,6 +13,11 @@ use POSIX qw(dup2); require IO::Handle; use PublicInbox::Spawn qw(spawn popen_rd); +# Documentation/SubmittingPatches recommends 12 (Linux v4.4) +my $abbrev = `git config core.abbrev` || 12; + +sub abbrev { "--abbrev=$abbrev" } + sub new { my ($class, $git_dir) = @_; bless { git_dir => $git_dir }, $class -- cgit v1.2.3-24-ge0c7