blame: require 0 context lines while finding moved lines with -M
The core part of git blame -M required 1 context line, but there is no rationale to be found in the code; it causes artifacts like discussed in the thread: <http://thread.gmane.org/gmane.comp.version-control.git/255289/>. <http://permalink.gmane.org/gmane.comp.version-control.git/295795> sheds some more light on the history of the previous choice. Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Kastrup committed
May 28, 2016 at 11:13 UTC
17a07e2ae2de36cadfac2349189e0c65e1c08d07
1 file changed
+3
-4
builtin/blame.c
+3
-4
@@ -134,7 +134,7 @@ struct progress_info {
134
int blamed_lines;
135
};
136
137
-static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,
137
+static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b,
138
xdl_emit_hunk_consume_func_t hunk_func, void *cb_data)
139
{
140
xpparam_t xpp = {0};
@@ -142,7 +142,6 @@ static int diff_hunks(mmfile_t *file_a, mmfile_t *file_b, long ctxlen,
142
xdemitcb_t ecb = {NULL};
143
144
xpp.flags = xdl_opts;
145
- xecfg.ctxlen = ctxlen;
145
xecfg.hunk_func = hunk_func;
146
ecb.priv = cb_data;
147
return xdi_diff(file_a, file_b, &xpp, &xecfg, &ecb);
@@ -980,7 +979,7 @@ static void pass_blame_to_parent(struct scoreboard *sb,
979
fill_origin_blob(&sb->revs->diffopt, target, &file_o);
980
num_get_patch++;
981
983
- if (diff_hunks(&file_p, &file_o, 0, blame_chunk_cb, &d))
982
+ if (diff_hunks(&file_p, &file_o, blame_chunk_cb, &d))
983
die("unable to generate diff (%s -> %s)",
984
oid_to_hex(&parent->commit->object.oid),
985
oid_to_hex(&target->commit->object.oid));
@@ -1129,7 +1128,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
1128
* file_p partially may match that image.
1129
*/
1130
memset(split, 0, sizeof(struct blame_entry [3]));
1132
- if (diff_hunks(file_p, &file_o, 1, handle_split_cb, &d))
1131
+ if (diff_hunks(file_p, &file_o, handle_split_cb, &d))
1132
die("unable to generate diff (%s)",
1133
oid_to_hex(&parent->commit->object.oid));
1134
/* remainder, if any, all match the preimage */