@@ -49,6 +49,7 @@ static const char rev_list_usage[] =
49
49
" --objects | --objects-edge\n"
50
50
" --unpacked\n"
51
51
" --header | --pretty\n"
52
+ " --no-object-names\n"
52
53
" --abbrev=<n> | --no-abbrev\n"
53
54
" --abbrev-commit\n"
54
55
" --left-right\n"
@@ -75,6 +76,9 @@ enum missing_action {
75
76
};
76
77
static enum missing_action arg_missing_action ;
77
78
79
+ /* display only the oid of each object encountered */
80
+ static int arg_no_object_names ;
81
+
78
82
#define DEFAULT_OIDSET_SIZE (16*1024)
79
83
80
84
static void finish_commit (struct commit * commit );
@@ -255,7 +259,10 @@ static void show_object(struct object *obj, const char *name, void *cb_data)
255
259
display_progress (progress , ++ progress_counter );
256
260
if (info -> flags & REV_LIST_QUIET )
257
261
return ;
258
- show_object_with_name (stdout , obj , name );
262
+ if (arg_no_object_names )
263
+ printf ("%s\n" , oid_to_hex (& obj -> oid ));
264
+ else
265
+ show_object_with_name (stdout , obj , name );
259
266
}
260
267
261
268
static void show_edge (struct commit * commit )
@@ -484,6 +491,11 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
484
491
if (skip_prefix (arg , "--missing=" , & arg ))
485
492
continue ; /* already handled above */
486
493
494
+ if (!strcmp (arg , ("--no-object-names" ))) {
495
+ arg_no_object_names = 1 ;
496
+ continue ;
497
+ }
498
+
487
499
usage (rev_list_usage );
488
500
489
501
}
0 commit comments