summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f291504)
raw | patch | inline | side by side (parent: f291504)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 Jun 2007 01:14:56 +0000 (18:14 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 Jun 2007 01:34:58 +0000 (18:34 -0700) |
When refactoring code to split one iteration of a too deeply
nested loop into a separate function, it inevitably makes the
indentation levels shallower (that's the sole point of such a
refactoring). With "git blame -w", you can ignore such
re-indentation and pass blame for such moved lines to the
parent.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
nested loop into a separate function, it inevitably makes the
indentation levels shallower (that's the sole point of such a
refactoring). With "git blame -w", you can ignore such
re-indentation and pass blame for such moved lines to the
parent.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-blame.txt | patch | blob | history | |
builtin-blame.c | patch | blob | history |
index 44678b0c3601512df024e3670aadeabd5317b0c9..66f1203701350f42cb028c6971c169ac129332ec 100644 (file)
SYNOPSIS
--------
[verse]
-'git-blame' [-c] [-b] [--root] [-s] [-l] [-t] [-f] [-n] [-p] [--incremental] [-L n,m]
+'git-blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [--incremental] [-L n,m]
[-S <revs-file>] [-M] [-C] [-C] [--since=<date>]
[<rev> | --contents <file>] [--] <file>
-s::
Suppress author name and timestamp from the output.
+-w::
+ Ignore whitespace when comparing parent's version and
+ child's to find where the lines came from.
+
+
THE PORCELAIN FORMAT
--------------------
diff --git a/builtin-blame.c b/builtin-blame.c
index 590533321a99bf4d00b872a839527f00616ed593..f7e2c13885a384d58c3481fa7259a64bf9525045 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
#include "mailmap.h"
static char blame_usage[] =
-"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"
+"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"
" -c Use the same output mode as git-annotate (Default: off)\n"
" -b Show blank SHA-1 for boundary commits (Default: off)\n"
" -l Show long commit SHA1 (Default: off)\n"
" -n, --show-number Show original linenumber (Default: off)\n"
" -s Suppress author name and timestamp (Default: off)\n"
" -p, --porcelain Show in a format designed for machine consumption\n"
+" -w Ignore whitespace differences\n"
" -L n,m Process only line range n,m, counting from 1\n"
" -M, -C Find line movements within and across files\n"
" --incremental Show blame entries as we find them, incrementally\n"
static int blank_boundary;
static int incremental;
static int cmd_is_annotate;
+static int xdl_opts = XDF_NEED_MINIMAL;
static struct path_list mailmap;
#ifndef DEBUG
xdemitconf_t xecfg;
xdemitcb_t ecb;
- xpp.flags = XDF_NEED_MINIMAL;
+ xpp.flags = xdl_opts;
xecfg.ctxlen = context;
xecfg.flags = 0;
ecb.outf = xdiff_outf;
output_option |= OUTPUT_LONG_OBJECT_NAME;
else if (!strcmp("-s", arg))
output_option |= OUTPUT_NO_AUTHOR;
+ else if (!strcmp("-w", arg))
+ xdl_opts |= XDF_IGNORE_WHITESPACE;
else if (!strcmp("-S", arg) && ++i < argc)
revs_file = argv[i];
else if (!prefixcmp(arg, "-M")) {