rev-parse --disambiguate=<prefix>
The new option allows you to feed an ambiguous prefix and enumerate all the objects that share it as a prefix of their object names. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -195,6 +195,12 @@ static int anti_reference(const char *refname, const unsigned char *sha1, int fl
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int show_abbrev(const unsigned char *sha1, void *cb_data)
|
||||
{
|
||||
show_rev(NORMAL, sha1, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void show_datestring(const char *flag, const char *datestr)
|
||||
{
|
||||
static char buffer[100];
|
||||
@ -589,6 +595,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
||||
for_each_ref(show_reference, NULL);
|
||||
continue;
|
||||
}
|
||||
if (!prefixcmp(arg, "--disambiguate=")) {
|
||||
for_each_abbrev(arg + 15, show_abbrev, NULL);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--bisect")) {
|
||||
for_each_ref_in("refs/bisect/bad", show_reference, NULL);
|
||||
for_each_ref_in("refs/bisect/good", anti_reference, NULL);
|
||||
|
||||
Reference in New Issue
Block a user