Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-28 00:58:47 +0300
committerJunio C Hamano <gitster@pobox.com>2016-10-28 00:58:47 +0300
commit580d820ece78100c5e2b8b5874d7aed5d76715f2 (patch)
tree5429c7137041134b69cd26ad10cd79e1416cc0a8 /builtin
parent2cc2e70264e0fcba04f9ef791d144bbc8b501206 (diff)
parente6c587c733b4634030b353f4024794b08bc86892 (diff)
Merge branch 'lt/abbrev-auto'
Allow the default abbreviation length, which has historically been 7, to scale as the repository grows. The logic suggests to use 12 hexdigits for the Linux kernel, and 9 to 10 for Git itself. * lt/abbrev-auto: abbrev: auto size the default abbreviation abbrev: prepare for new world order abbrev: add FALLBACK_DEFAULT_ABBREV to prepare for auto sizing
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c3
-rw-r--r--builtin/rev-parse.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 74c0546362..b2e113d387 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -17,6 +17,9 @@
#include "argv-array.h"
#include "utf8.h"
+#define TRANSPORT_SUMMARY(x) \
+ (int)(TRANSPORT_SUMMARY_WIDTH + strlen(x) - gettext_width(x)), (x)
+
static const char * const builtin_fetch_usage[] = {
N_("git fetch [<options>] [<repository> [<refspec>...]]"),
N_("git fetch [<options>] <group>"),
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 4da1f1da25..cfb0f1510c 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -671,8 +671,9 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
filter &= ~(DO_FLAGS|DO_NOREV);
verify = 1;
abbrev = DEFAULT_ABBREV;
- if (arg[7] == '=')
- abbrev = strtoul(arg + 8, NULL, 10);
+ if (!arg[7])
+ continue;
+ abbrev = strtoul(arg + 8, NULL, 10);
if (abbrev < MINIMUM_ABBREV)
abbrev = MINIMUM_ABBREV;
else if (40 <= abbrev)