Skip to content

Commit adfe4e1

Browse files
committed
Merge branch 'maint'
* maint: Revert "core.abbrevguard: Ensure short object names stay unique a bit longer"
2 parents 83c3c62 + ea2c69e commit adfe4e1

File tree

5 files changed

+1
-21
lines changed

5 files changed

+1
-21
lines changed

Documentation/config.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,6 @@ core.warnAmbiguousRefs::
376376
If true, git will warn you if the ref name you passed it is ambiguous
377377
and might match multiple refs in the .git/refs/ tree. True by default.
378378

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-
388379
core.compression::
389380
An integer -1..9, indicating a default compression level.
390381
-1 is the zlib default. 0 means no compression,

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ extern int assume_unchanged;
560560
extern int prefer_symlink_refs;
561561
extern int log_all_ref_updates;
562562
extern int warn_ambiguous_refs;
563-
extern int unique_abbrev_extra_length;
564563
extern int shared_repository;
565564
extern const char *apply_default_whitespace;
566565
extern const char *apply_default_ignorewhitespace;

config.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,6 @@ static int git_default_core_config(const char *var, const char *value)
499499
return 0;
500500
}
501501

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-
509502
if (!strcmp(var, "core.bare")) {
510503
is_bare_repository_cfg = git_config_bool(var, value);
511504
return 0;

environment.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ int prefer_symlink_refs;
2121
int is_bare_repository_cfg = -1; /* unspecified */
2222
int log_all_ref_updates = -1; /* unspecified */
2323
int warn_ambiguous_refs = 1;
24-
int unique_abbrev_extra_length;
2524
int repository_format_version;
2625
const char *git_commit_encoding;
2726
const char *git_log_output_encoding;

sha1_name.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,7 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
208208
if (exists
209209
? !status
210210
: 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;
214212
return hex;
215213
}
216214
len++;

0 commit comments

Comments
 (0)