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>
This commit is contained in:
Junio C Hamano
2016-11-01 18:34:07 -07:00
parent be5a750939
commit 48d5014dd4
2 changed files with 15 additions and 8 deletions

View File

@ -834,10 +834,16 @@ static int git_default_core_config(const char *var, const char *value)
}
if (!strcmp(var, "core.abbrev")) {
int abbrev = git_config_int(var, value);
if (abbrev < minimum_abbrev || abbrev > 40)
return -1;
default_abbrev = abbrev;
if (!value)
return config_error_nonbool(var);
if (!strcasecmp(value, "auto"))
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;
}