threads / patch / 7110

patchrevision walker --boundary: show boundaries again

Subject: [PATCH] revision walker --boundary: show boundaries again

## tl;dr

3 messages between Mar 6, 2007 and Mar 7, 2007. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Johannes Schindelin· Mar 6, 2007, 11:54 UTC · lore

Without this patch, "git rev-list --boundary master^..master" shows only master's object name, and nothing else.

It is mainly an indentation patch, because it delays exit in get_revision() until after revs->boundary was checked.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	Sorry, I don't have time to write a test case, as I have to run.
 revision.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
Show changes to revision.c +23 −23
diff --git a/revision.c b/revision.c
index 35a1711..b6b9fc0 100644
--- a/revision.c
+++ b/revision.c
@@ -1301,31 +1301,31 @@ struct commit *get_revision(struct rev_info *revs)
 	/*
 	 * Now pick up what they want to give us
 	 */
-	if (!(c = get_revision_1(revs)))
-		return NULL;
-	while (0 < revs->skip_count) {
-		revs->skip_count--;
-		c = get_revision_1(revs);
-		if (!c)
-			break;
-	}
+	if ((c = get_revision_1(revs))) {
+		while (0 < revs->skip_count) {
+			revs->skip_count--;
+			c = get_revision_1(revs);
+			if (!c)
+				break;
+		}
 
-	/*
-	 * Check the max_count.
-	 */
-	switch (revs->max_count) {
-	case -1:
-		break;
-	case 0:
-		/* Although we grabbed it, it is not shown. */
-		c = NULL;
-		break;
-	default:
-		revs->max_count--;
-	}
+		/*
+		 * Check the max_count.
+		 */
+		switch (revs->max_count) {
+			case -1:
+				break;
+			case 0:
+				/* Although we grabbed it, it is not shown. */
+				c = NULL;
+				break;
+			default:
+				revs->max_count--;
+		}
 
-	if (c)
-		c->object.flags |= SHOWN;
+		if (c)
+			c->object.flags |= SHOWN;
+	}
 
 	if (!revs->boundary) {
 		return c;
-- 
1.5.0.3.2551.gf95a-dirty
Junio C Hamano· Mar 6, 2007, 23:02 UTC · re: Johannes Schindelin · lore

Re: [PATCH] revision walker --boundary: show boundaries again

Thanks.

I noticed the breakage after those 4 series and have two fixups near the tip of 'next', namely 8839ac94. Does it not work for you?

Btw, the version of gitweb running on git.kernel.org seems to be broken. Clicking on 'next' label itself or 'shortlog' link next to it would not show what's requested for 'next', but 'log' link seems to work.

Johannes Schindelin· Mar 7, 2007, 00:00 UTC · re: Junio C Hamano · lore

Re: [PATCH] revision walker --boundary: show boundaries again

Hi,
On Tue, 6 Mar 2007, Junio C Hamano wrote:
Show 5 quoted lines
> Thanks.
> 
> I noticed the breakage after those 4 series and have two fixups
> near the tip of 'next', namely 8839ac94.  Does it not work for
> you?
Yes, but I got those commits only _after_ I sent the patch.

Anyway, I saw that it broke when I was trying to make really, really sure that bundles worked as expected, by writing a strict test case.

Ciao, Dscho

← back to recent threads