abbrev: add FALLBACK_DEFAULT_ABBREV to prepare for auto sizing
We'll be introducing a new way to decide the default abbreviation length by initialising DEFAULT_ABBREV to -1 to signal the first call to "find unique abbreviation" codepath to compute a reasonable value based on the number of objects we have to avoid collisions. We have long relied on DEFAULT_ABBREV being a positive concrete value that is used as the abbreviation length when no extra configuration or command line option has overridden it. Some codepaths wants to use such a positive concrete default value even before making their first request to actually trigger the computation for the auto sized default. Introduce FALLBACK_DEFAULT_ABBREV and use it to the code that attempts to align the report from "git fetch". For now, this macro is also used to initialize the default_abbrev variable, but the auto-sizing code will use -1 and then use the value of FALLBACK_DEFAULT_ABBREV as the starting point of auto-sizing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
3
cache.h
3
cache.h
@ -1183,6 +1183,9 @@ static inline int hex2chr(const char *s)
|
||||
#define MINIMUM_ABBREV minimum_abbrev
|
||||
#define DEFAULT_ABBREV default_abbrev
|
||||
|
||||
/* used when the code does not know or care what the default abbrev is */
|
||||
#define FALLBACK_DEFAULT_ABBREV 7
|
||||
|
||||
struct object_context {
|
||||
unsigned char tree[20];
|
||||
char path[PATH_MAX];
|
||||
|
Reference in New Issue
Block a user