config.abbrev: document the new default that auto-scales
We somehow forgot to update the "default is 7" in the documentation. Also give a way to explicitly ask the auto-scaling by setting config.abbrev to "auto". Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
be5a750939
commit
48d5014dd4
|
@ -783,10 +783,11 @@ core.sparseCheckout::
|
||||||
linkgit:git-read-tree[1] for more information.
|
linkgit:git-read-tree[1] for more information.
|
||||||
|
|
||||||
core.abbrev::
|
core.abbrev::
|
||||||
Set the length object names are abbreviated to. If unspecified,
|
Set the length object names are abbreviated to. If
|
||||||
many commands abbreviate to 7 hexdigits, which may not be enough
|
unspecified or set to "auto", an appropriate value is
|
||||||
for abbreviated object names to stay unique for sufficiently long
|
computed based on the approximate number of packed objects
|
||||||
time.
|
in your repository, which hopefully is enough for
|
||||||
|
abbreviated object names to stay unique for some time.
|
||||||
|
|
||||||
add.ignoreErrors::
|
add.ignoreErrors::
|
||||||
add.ignore-errors (deprecated)::
|
add.ignore-errors (deprecated)::
|
||||||
|
|
14
config.c
14
config.c
|
@ -834,10 +834,16 @@ static int git_default_core_config(const char *var, const char *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(var, "core.abbrev")) {
|
if (!strcmp(var, "core.abbrev")) {
|
||||||
int abbrev = git_config_int(var, value);
|
if (!value)
|
||||||
if (abbrev < minimum_abbrev || abbrev > 40)
|
return config_error_nonbool(var);
|
||||||
return -1;
|
if (!strcasecmp(value, "auto"))
|
||||||
default_abbrev = abbrev;
|
default_abbrev = -1;
|
||||||
|
else {
|
||||||
|
int abbrev = git_config_int(var, value);
|
||||||
|
if (abbrev < minimum_abbrev || abbrev > 40)
|
||||||
|
return error("abbrev length out of range: %d", abbrev);
|
||||||
|
default_abbrev = abbrev;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue