From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 9/9] core.abbrev: raise the default abbreviation to 12 hexdigits
Date: Thu, 29 Sep 2016 14:00:14 -0700 [thread overview]
Message-ID: <20160929210014.3874-10-gitster@pobox.com> (raw)
In-Reply-To: <20160929210014.3874-1-gitster@pobox.com>
As Peff said, responding in a thread started by Linus's suggestion
to raise the default abbreviation to 12 hexdigits:
I actually think "12" might be sane for a long time. That's 48
bits of sha1, so we'd expect a 50% chance of a single collision
at 2^24, or 16 million. The biggest repository I know about (in
number of objects) is the one holding all of the objects for all
of the forks of torvalds/linux on GitHub. It's at about 15
million objects.
Which seems close, but remember that's the size where we expect
to see a single collision. They don't become common until much
later (I didn't compute an exact number, but Linus's 16x sounds
about right). I know that the growth of the kernel isn't really
linear, but I think the need to bump to "13" might not just be
decades, but possibly a century or more.
So 12 seems reasonable, and the only downside for it (or for "13", for
that matter) is a few extra bytes. I dunno, maybe people will really
hate that, but I have a feeling these are mostly cut-and-pasted anyway.
And this does exactly that.
Keep the tests working by explicitly asking for the old 7 hexdigits
setting in the fake system-wide configuration file used for tests.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
environment.c | 2 +-
t/gitconfig-for-test | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/environment.c b/environment.c
index ca72464a9850..25daddbc13d6 100644
--- a/environment.c
+++ b/environment.c
@@ -16,7 +16,7 @@ int trust_executable_bit = 1;
int trust_ctime = 1;
int check_stat = 1;
int has_symlinks = 1;
-int minimum_abbrev = 4, default_abbrev = 7;
+int minimum_abbrev = 4, default_abbrev = 12;
int ignore_case;
int assume_unchanged;
int prefer_symlink_refs;
diff --git a/t/gitconfig-for-test b/t/gitconfig-for-test
index 4598885ed5c3..8c284425d725 100644
--- a/t/gitconfig-for-test
+++ b/t/gitconfig-for-test
@@ -4,3 +4,6 @@
;; [user]
;; name = A U Thor
;; email = author@example.com
+
+[core]
+ abbrev = 7
--
2.10.0-589-g5adf4e1
prev parent reply other threads:[~2016-09-29 21:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 21:00 [PATCH v2 0/9] allow customizing /etc/gitconfig location with an environment Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 1/9] config: " Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 2/9] t1300: always compare expect to actual Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 3/9] t1308: ignore system-wide config in the iteration test Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 4/9] t1300: check also system-wide configuration file in --show-origin tests Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 5/9] t1300: disable system-wide config for tests that wants to read from -c Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 6/9] t1300: take contents of system-wide configuration into account in "--list" test Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 7/9] t1300: be explicit in local configuration tests Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 8/9] worktree: honor configuration variables Junio C Hamano
2016-09-29 21:00 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160929210014.3874-10-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).