git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Junio C Hamano <gitster@pobox.com>
Cc: <git@vger.kernel.org>
Subject: [PATCH 4/4] log -L: improve comments in process_all_files()
Date: Fri, 12 Apr 2013 18:05:12 +0200	[thread overview]
Message-ID: <4f96a58897d36d9540bdfb9c0ed291ebd9d1eceb.1365781999.git.trast@inf.ethz.ch> (raw)
In-Reply-To: <cover.1365781999.git.trast@inf.ethz.ch>

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>
---
 line-log.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/line-log.c b/line-log.c
index 44d1cd5..4bbb09b 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]);
-- 
1.8.2.1.567.g8ad0f43

      parent reply	other threads:[~2013-04-12 16:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 22:27 What's cooking in git.git (Apr 2013, #02; Fri, 5) Junio C Hamano
2013-04-07 10:38 ` John Keeping
2013-04-12  9:56 ` Thomas Rast
2013-04-12 16:05   ` [PATCH 0/4] fix log -L -M Thomas Rast
2013-04-12 16:05     ` [PATCH 1/4] t4211: pass -M to 'git log -M -L...' test Thomas Rast
2013-04-12 16:05     ` [PATCH 2/4] log -L: test merge of parallel modify/rename Thomas Rast
2013-04-12 16:05     ` [PATCH 3/4] log -L: store the path instead of a diff_filespec Thomas Rast
2013-04-12 16:05     ` Thomas Rast [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f96a58897d36d9540bdfb9c0ed291ebd9d1eceb.1365781999.git.trast@inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).