@matheusbsbs / matheus-bagliano / commits / ea2c69ed47
Fork 0

Revert "core.abbrevguard: Ensure short object names stay unique a bit longer"

This reverts commit 72a5b561fc1c4286bc7c5b0693afc076af261e1f, as adding fixed number of hexdigits more than necessary to make one object name locally unique does not help in futureproofing the uniqueness of names we generate today. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 10, 2011 at 22:41 UTC ea2c69ed4728070be1d2ee953a6948398b859150
5 files changed +1 -21
Documentation/config.txt
-9
@@ -376,15 +376,6 @@ core.warnAmbiguousRefs::
376 If true, git will warn you if the ref name you passed it is ambiguous
377 and might match multiple refs in the .git/refs/ tree. True by default.
378
379 -core.abbrevguard::
380 - Even though git makes sure that it uses enough hexdigits to show
381 - an abbreviated object name unambiguously, as more objects are
382 - added to the repository over time, a short name that used to be
383 - unique will stop being unique. Git uses this many extra hexdigits
384 - that are more than necessary to make the object name currently
385 - unique, in the hope that its output will stay unique a bit longer.
386 - Defaults to 0.
387 -
379 core.compression::
380 An integer -1..9, indicating a default compression level.
381 -1 is the zlib default. 0 means no compression,
cache.h
-1
@@ -545,7 +545,6 @@ extern int assume_unchanged;
545 extern int prefer_symlink_refs;
546 extern int log_all_ref_updates;
547 extern int warn_ambiguous_refs;
548 -extern int unique_abbrev_extra_length;
548 extern int shared_repository;
549 extern const char *apply_default_whitespace;
550 extern const char *apply_default_ignorewhitespace;
config.c
-7
@@ -499,13 +499,6 @@ static int git_default_core_config(const char *var, const char *value)
499 return 0;
500 }
501
502 - if (!strcmp(var, "core.abbrevguard")) {
503 - unique_abbrev_extra_length = git_config_int(var, value);
504 - if (unique_abbrev_extra_length < 0)
505 - unique_abbrev_extra_length = 0;
506 - return 0;
507 - }
508 -
502 if (!strcmp(var, "core.bare")) {
503 is_bare_repository_cfg = git_config_bool(var, value);
504 return 0;
environment.c
-1
@@ -21,7 +21,6 @@ int prefer_symlink_refs;
21 int is_bare_repository_cfg = -1; /* unspecified */
22 int log_all_ref_updates = -1; /* unspecified */
23 int warn_ambiguous_refs = 1;
24 -int unique_abbrev_extra_length;
24 int repository_format_version;
25 const char *git_commit_encoding;
26 const char *git_log_output_encoding;
sha1_name.c
+1 -3
@@ -208,9 +208,7 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
208 if (exists
209 ? !status
210 : status == SHORT_NAME_NOT_FOUND) {
211 - int cut_at = len + unique_abbrev_extra_length;
212 - cut_at = (cut_at < 40) ? cut_at : 40;
213 - hex[cut_at] = 0;
211 + hex[len] = 0;
212 return hex;
213 }
214 len++;