Skip to content

Commit 1ddac3f

Browse files
Thomas Rastgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 31c6191 commit 1ddac3f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

line-log.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,11 +1095,24 @@ static int process_all_files(struct line_log_data **range_out,
10951095

10961096
for (i = 0; i < queue->nr; i++) {
10971097
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+
*/
10991113
struct line_log_data *rg = range;
11001114
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))
11031116
rg = rg->next;
11041117
assert(rg);
11051118
rg->pair = diff_filepair_dup(queue->queue[i]);

0 commit comments

Comments
 (0)