@@ -35,6 +35,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
3535 struct rev_info * rev )
3636{
3737 int i ;
38+ int decoration_style = 0 ;
3839
3940 rev -> abbrev = DEFAULT_ABBREV ;
4041 rev -> commit_format = CMIT_FMT_DEFAULT ;
@@ -61,15 +62,26 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
6162 for (i = 1 ; i < argc ; i ++ ) {
6263 const char * arg = argv [i ];
6364 if (!strcmp (arg , "--decorate" )) {
64- load_ref_decorations ();
65- rev -> show_decorations = 1 ;
65+ decoration_style = DECORATE_SHORT_REFS ;
66+ } else if (!prefixcmp (arg , "--decorate=" )) {
67+ const char * v = skip_prefix (arg , "--decorate=" );
68+ if (!strcmp (v , "full" ))
69+ decoration_style = DECORATE_FULL_REFS ;
70+ else if (!strcmp (v , "short" ))
71+ decoration_style = DECORATE_SHORT_REFS ;
72+ else
73+ die ("invalid --decorate option: %s" , arg );
6674 } else if (!strcmp (arg , "--source" )) {
6775 rev -> show_source = 1 ;
6876 } else if (!strcmp (arg , "-h" )) {
6977 usage (builtin_log_usage );
7078 } else
7179 die ("unrecognized argument: %s" , arg );
7280 }
81+ if (decoration_style ) {
82+ rev -> show_decorations = 1 ;
83+ load_ref_decorations (decoration_style );
84+ }
7385}
7486
7587/*
0 commit comments