summaryrefslogtreecommitdiff
path: root/line-log.c
diff options
context:
space:
mode:
authorThomas Rast <trast@inf.ethz.ch>2013-04-12 18:05:12 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-12 11:37:09 -0700
commit1ddac3ff9aa29d1103aa05f59772812289b4cefa (patch)
tree9ec4eaab51b1f1192be7e6da764f9d122f80b3dd /line-log.c
parent31c61918313c7057a48ac939d8699860e8bfff99 (diff)
downloadgit-1ddac3ff9aa29d1103aa05f59772812289b4cefa.tar.gz
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>
Diffstat (limited to 'line-log.c')
-rw-r--r--line-log.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/line-log.c b/line-log.c
index 44d1cd510d..4bbb09be59 100644
--- a/line-log.c
+++ b/line-log.c
@@ -1095,11 +1095,24 @@ static int process_all_files(struct line_log_data **range_out,
for (i = 0; i < queue->nr; i++) {
struct diff_ranges *pairdiff = NULL;
- if (process_diff_filepair(rev, queue->queue[i], *range_out, &pairdiff)) {
+ struct diff_filepair *pair = queue->queue[i];
+ if (process_diff_filepair(rev, pair, *range_out, &pairdiff)) {
+ /*
+ * Store away the diff for later output. We
+ * tuck it in the ranges we got as _input_,
+ * since that's the commit that caused the
+ * diff.
+ *
+ * NEEDSWORK not enough when we get around to
+ * doing something interesting with merges;
+ * currently each invocation on a merge parent
+ * trashes the previous one's diff.
+ *
+ * NEEDSWORK tramples over data structures not owned here
+ */
struct line_log_data *rg = range;
changed++;
- /* NEEDSWORK tramples over data structures not owned here */
- while (rg && strcmp(rg->path, queue->queue[i]->two->path))
+ while (rg && strcmp(rg->path, pair->two->path))
rg = rg->next;
assert(rg);
rg->pair = diff_filepair_dup(queue->queue[i]);