#define REVERSED 1
static int show_type = NORMAL;
static int symbolic = 0;
+static int abbrev = 0;
static int output_sq = 0;
static int revs_count = 0;
putchar('^');
if (symbolic && name)
show(name);
+ else if (abbrev)
+ show(find_unique_abbrev(sha1, abbrev));
else
show(sha1_to_hex(sha1));
}
verify = 1;
continue;
}
+ if (!strcmp(arg, "--abbrev") ||
+ !strncmp(arg, "--abbrev=", 9)) {
+ filter &= ~(DO_FLAGS|DO_NOREV);
+ verify = 1;
+ abbrev = DEFAULT_ABBREV;
+ if (arg[8] == '=')
+ abbrev = strtoul(arg + 9, NULL, 10);
+ if (abbrev < 0 || 40 <= abbrev)
+ abbrev = DEFAULT_ABBREV;
+ continue;
+ }
if (!strcmp(arg, "--sq")) {
output_sq = 1;
continue;