aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-09-27 08:38:01 -0400
committerJunio C Hamano <gitster@pobox.com>2016-09-27 10:29:56 -0700
commit5b33cb1fd733f581da07ae8afa7e9547eafd248e (patch)
tree439c5016deef9764172bca39e773ecaba2fec330 /cache.h
parent1ffa26c4614720f8bb6c04703c7b65b34bd93fe3 (diff)
downloadgit-5b33cb1fd733f581da07ae8afa7e9547eafd248e.tar.gz
git-5b33cb1fd733f581da07ae8afa7e9547eafd248e.tar.xz
get_short_sha1: make default disambiguation configurable
When we find ambiguous short sha1s, we may get a disambiguation rule from our caller's context. But if we don't, we fall back to treating all sha1s the same, even though most projects will tend to refer only to commits by their short sha1s. This patch introduces a configuration option that lets the user pick a different fallback (e.g., only commits). It's possible that we may want to make this the default, but it's a good idea to start as a config option for two reasons: 1. It lets people experiment with this and see if it's a good idea (i.e., the "tend to" above is an assumption; we don't really know if this will break some obscure cases). 2. Even if we do flip the default, it gives people an escape hatch if it causes problems (you can sometimes override it by asking for "1234^{tree}", but not all combinations are possible). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 7bd78ca28..f346c0170 100644
--- a/cache.h
+++ b/cache.h
@@ -1222,6 +1222,8 @@ extern int get_oid(const char *str, struct object_id *oid);
typedef int each_abbrev_fn(const unsigned char *sha1, void *);
extern int for_each_abbrev(const char *prefix, each_abbrev_fn, void *);
+extern int set_disambiguate_hint_config(const char *var, const char *value);
+
/*
* Try to read a SHA1 in hexadecimal format from the 40 characters
* starting at hex. Write the 20-byte result to sha1 in binary form.