Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Junio C Hamano <junkio@cox.net>
Subject: Re: gitk problems: can't unset "idinlist(...)"
Date: Sat, 21 Jul 2007 02:24:48 -0400	[thread overview]
Message-ID: <20070721062448.GA8722@coredump.intra.peff.net> (raw)
In-Reply-To: <20070721061857.GB29820@coredump.intra.peff.net>

On Sat, Jul 21, 2007 at 02:18:57AM -0400, Jeff King wrote:

> correct to me (though there are some unrelated formatting changes which
> made it a little harder to read).

By which I mean you can keep the 'for' loop, since in either case we are
always reading p->next (if we skip, then we set *pp to p->next anyway,
and if we don't, then pp becomes a pointer to p->next).

So this is a more readable patch which I believe is equivalent.

---
diff --git a/revision.c b/revision.c
index 28b5f2e..7def867 100644
--- a/revision.c
+++ b/revision.c
@@ -1329,10 +1329,11 @@ static void remove_duplicate_parents(struct commit *commit)
 	/* Examine existing parents while marking ones we have seen... */
 	for (p = commit->parents; p; p = p->next) {
 		struct commit *parent = p->item;
-		if (parent->object.flags & TMP_MARK)
+		if (parent->object.flags & TMP_MARK) {
+			*pp = p->next;
 			continue;
+		}
 		parent->object.flags |= TMP_MARK;
-		*pp = p;
 		pp = &p->next;
 	}
 	/* ... and clear the temporary mark */

  reply	other threads:[~2007-07-21  6:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 23:05 gitk problems: can't unset "idinlist(...)" Linus Torvalds
2007-07-21  5:09 ` Jeff King
2007-07-21  5:53   ` Linus Torvalds
2007-07-21  5:56     ` Junio C Hamano
2007-07-21  5:59     ` Jeff King
2007-07-21  6:06       ` Jeff King
2007-07-21  6:11     ` Linus Torvalds
2007-07-21  6:18       ` Jeff King
2007-07-21  6:24         ` Jeff King [this message]
2007-07-21  6:47           ` Linus Torvalds
2007-07-21  6:54             ` Jeff King
2007-07-21  9:32             ` pointer to pointer (was: gitk problems: can't unset "idinlist(...)") David Kastrup
2007-07-21  9:44               ` pointer to pointer David Kastrup
2007-07-21  6:34         ` gitk problems: can't unset "idinlist(...)" Linus Torvalds
2007-07-21 11:42 ` Paul Mackerras

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=20070721062448.GA8722@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=paulus@samba.org \
    --cc=torvalds@linux-foundation.org \
    /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