20
20
#include "mailmap.h"
21
21
22
22
static char blame_usage [] =
23
- "git-blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [--contents <filename>] [--incremental] [commit] [--] file\n"
23
+ "git-blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [- L n,m] [-S <revs-file>] [-M] [-C] [-C] [--contents <filename>] [--incremental] [commit] [--] file\n"
24
24
" -c Use the same output mode as git-annotate (Default: off)\n"
25
25
" -b Show blank SHA-1 for boundary commits (Default: off)\n"
26
26
" -l Show long commit SHA1 (Default: off)\n"
@@ -30,6 +30,7 @@ static char blame_usage[] =
30
30
" -n, --show-number Show original linenumber (Default: off)\n"
31
31
" -s Suppress author name and timestamp (Default: off)\n"
32
32
" -p, --porcelain Show in a format designed for machine consumption\n"
33
+ " -w Ignore whitespace differences\n"
33
34
" -L n,m Process only line range n,m, counting from 1\n"
34
35
" -M, -C Find line movements within and across files\n"
35
36
" --incremental Show blame entries as we find them, incrementally\n"
@@ -45,6 +46,7 @@ static int show_root;
45
46
static int blank_boundary ;
46
47
static int incremental ;
47
48
static int cmd_is_annotate ;
49
+ static int xdl_opts = XDF_NEED_MINIMAL ;
48
50
static struct path_list mailmap ;
49
51
50
52
#ifndef DEBUG
@@ -515,7 +517,7 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
515
517
xdemitconf_t xecfg ;
516
518
xdemitcb_t ecb ;
517
519
518
- xpp .flags = XDF_NEED_MINIMAL ;
520
+ xpp .flags = xdl_opts ;
519
521
xecfg .ctxlen = context ;
520
522
xecfg .flags = 0 ;
521
523
ecb .outf = xdiff_outf ;
@@ -1744,11 +1746,11 @@ static int read_ancestry(const char *graft_file)
1744
1746
*/
1745
1747
static int lineno_width (int lines )
1746
1748
{
1747
- int i , width ;
1749
+ int i , width ;
1748
1750
1749
- for (width = 1 , i = 10 ; i <= lines + 1 ; width ++ )
1750
- i *= 10 ;
1751
- return width ;
1751
+ for (width = 1 , i = 10 ; i <= lines + 1 ; width ++ )
1752
+ i *= 10 ;
1753
+ return width ;
1752
1754
}
1753
1755
1754
1756
/*
@@ -2159,6 +2161,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2159
2161
output_option |= OUTPUT_LONG_OBJECT_NAME ;
2160
2162
else if (!strcmp ("-s" , arg ))
2161
2163
output_option |= OUTPUT_NO_AUTHOR ;
2164
+ else if (!strcmp ("-w" , arg ))
2165
+ xdl_opts |= XDF_IGNORE_WHITESPACE ;
2162
2166
else if (!strcmp ("-S" , arg ) && ++ i < argc )
2163
2167
revs_file = argv [i ];
2164
2168
else if (!prefixcmp (arg , "-M" )) {
0 commit comments