2020#include "mailmap.h"
2121
2222static 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"
2424" -c Use the same output mode as git-annotate (Default: off)\n"
2525" -b Show blank SHA-1 for boundary commits (Default: off)\n"
2626" -l Show long commit SHA1 (Default: off)\n"
@@ -30,6 +30,7 @@ static char blame_usage[] =
3030" -n, --show-number Show original linenumber (Default: off)\n"
3131" -s Suppress author name and timestamp (Default: off)\n"
3232" -p, --porcelain Show in a format designed for machine consumption\n"
33+ " -w Ignore whitespace differences\n"
3334" -L n,m Process only line range n,m, counting from 1\n"
3435" -M, -C Find line movements within and across files\n"
3536" --incremental Show blame entries as we find them, incrementally\n"
@@ -45,6 +46,7 @@ static int show_root;
4546static int blank_boundary ;
4647static int incremental ;
4748static int cmd_is_annotate ;
49+ static int xdl_opts = XDF_NEED_MINIMAL ;
4850static struct path_list mailmap ;
4951
5052#ifndef DEBUG
@@ -515,7 +517,7 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
515517 xdemitconf_t xecfg ;
516518 xdemitcb_t ecb ;
517519
518- xpp .flags = XDF_NEED_MINIMAL ;
520+ xpp .flags = xdl_opts ;
519521 xecfg .ctxlen = context ;
520522 xecfg .flags = 0 ;
521523 ecb .outf = xdiff_outf ;
@@ -1744,11 +1746,11 @@ static int read_ancestry(const char *graft_file)
17441746 */
17451747static int lineno_width (int lines )
17461748{
1747- int i , width ;
1749+ int i , width ;
17481750
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 ;
17521754}
17531755
17541756/*
@@ -2159,6 +2161,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
21592161 output_option |= OUTPUT_LONG_OBJECT_NAME ;
21602162 else if (!strcmp ("-s" , arg ))
21612163 output_option |= OUTPUT_NO_AUTHOR ;
2164+ else if (!strcmp ("-w" , arg ))
2165+ xdl_opts |= XDF_IGNORE_WHITESPACE ;
21622166 else if (!strcmp ("-S" , arg ) && ++ i < argc )
21632167 revs_file = argv [i ];
21642168 else if (!prefixcmp (arg , "-M" )) {
0 commit comments