@@ -41,6 +41,7 @@ static int reverse;
41
41
static int blank_boundary ;
42
42
static int incremental ;
43
43
static int xdl_opts ;
44
+ static int abbrev = -1 ;
44
45
45
46
static enum date_mode blame_date_mode = DATE_ISO8601 ;
46
47
static size_t blame_date_width ;
@@ -1670,7 +1671,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
1670
1671
cp = nth_line (sb , ent -> lno );
1671
1672
for (cnt = 0 ; cnt < ent -> num_lines ; cnt ++ ) {
1672
1673
char ch ;
1673
- int length = (opt & OUTPUT_LONG_OBJECT_NAME ) ? 40 : 8 ;
1674
+ int length = (opt & OUTPUT_LONG_OBJECT_NAME ) ? 40 : abbrev ;
1674
1675
1675
1676
if (suspect -> commit -> object .flags & UNINTERESTING ) {
1676
1677
if (blank_boundary )
@@ -2310,6 +2311,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2310
2311
{ OPTION_CALLBACK , 'C' , NULL , & opt , "score" , "Find line copies within and across files" , PARSE_OPT_OPTARG , blame_copy_callback },
2311
2312
{ OPTION_CALLBACK , 'M' , NULL , & opt , "score" , "Find line movements within and across files" , PARSE_OPT_OPTARG , blame_move_callback },
2312
2313
OPT_CALLBACK ('L' , NULL , & bottomtop , "n,m" , "Process only line range n,m, counting from 1" , blame_bottomtop_callback ),
2314
+ OPT__ABBREV (& abbrev ),
2313
2315
OPT_END ()
2314
2316
};
2315
2317
@@ -2345,6 +2347,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2345
2347
parse_done :
2346
2348
argc = parse_options_end (& ctx );
2347
2349
2350
+ if (abbrev == -1 )
2351
+ abbrev = default_abbrev ;
2352
+ /* one more abbrev length is needed for the boundary commit */
2353
+ abbrev ++ ;
2354
+
2348
2355
if (revs_file && read_ancestry (revs_file ))
2349
2356
die_errno ("reading graft file '%s' failed" , revs_file );
2350
2357
0 commit comments