log -L: improve comments in process_all_files()
The funny range assignment in process_all_files() had me sidetracked while investigating what led to the previous commit. Let's improve the comments. Signed-off-by: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Apr 12, 2013 at 18:05 UTC
1ddac3ff9aa29d1103aa05f59772812289b4cefa
1 file changed
+16
-3
line-log.c
+16
-3
@@ -1095,11 +1095,24 @@ static int process_all_files(struct line_log_data **range_out,
1095
1096
for (i = 0; i < queue->nr; i++) {
1097
struct diff_ranges *pairdiff = NULL;
1098
- if (process_diff_filepair(rev, queue->queue[i], *range_out, &pairdiff)) {
1098
+ struct diff_filepair *pair = queue->queue[i];
1099
+ if (process_diff_filepair(rev, pair, *range_out, &pairdiff)) {
1100
+ /*
1101
+ * Store away the diff for later output. We
1102
+ * tuck it in the ranges we got as _input_,
1103
+ * since that's the commit that caused the
1104
+ * diff.
1105
+ *
1106
+ * NEEDSWORK not enough when we get around to
1107
+ * doing something interesting with merges;
1108
+ * currently each invocation on a merge parent
1109
+ * trashes the previous one's diff.
1110
+ *
1111
+ * NEEDSWORK tramples over data structures not owned here
1112
+ */
1113
struct line_log_data *rg = range;
1114
changed++;
1101
- /* NEEDSWORK tramples over data structures not owned here */
1102
- while (rg && strcmp(rg->path, queue->queue[i]->two->path))
1115
+ while (rg && strcmp(rg->path, pair->two->path))
1116
rg = rg->next;
1117
assert(rg);
1118
rg->pair = diff_filepair_dup(queue->queue[i]);