git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] rev-list --max-age, --max-count: support --boundary

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 19, 2007, 02:14 UTC
Message-ID
<Pine.LNX.4.63.0702190312120.22628@wbgn013.biozentrum.uni-wuerzburg.de>

Now, when saying --max-age=<timestamp>, or --max-count=<n>, together with --boundary, rev-list prints the boundary commits, i.e. the commits which are _just_ not shown without --boundary, i.e. their children are, but they aren't.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	Of course, this is meant to speed up an otherwise expensive
	operation in git-bundle.
	However, this touches a very sensitive point in core git:
	the revision walking machinery. It passes all tests, but
	some eyeballing is much appreciated.
	Ah, and somebody better at writing short concise descriptions
	then me should look into documenting "edge" objects and
	"boundary" commits to the glossary (possibly after thinking
	if "edge" and "boundary" do mean the same after all).
	'nough for one night.
 revision.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/revision.c b/revision.c
index 5b1794b..87aea9c 100644
--- a/revision.c
+++ b/revision.c
@@ -1233,9 +1233,15 @@ static struct commit *get_revision_1(struct rev_info *revs)
 		 */
 		if (!revs->limited) {
 			if (revs->max_age != -1 &&
-			    (commit->date < revs->max_age))
-				continue;
-			add_parents_to_list(revs, commit, &revs->commits);
+			    (commit->date < revs->max_age)) {
+				if (revs->boundary)
+					commit->object.flags |=
+						BOUNDARY_SHOW | BOUNDARY;
+				else
+					continue;
+			} else
+				add_parents_to_list(revs, commit,
+						&revs->commits);
 		}
 		if (commit->object.flags & SHOWN)
 			continue;
@@ -1336,7 +1342,17 @@ struct commit *get_revision(struct rev_info *revs)
 	case -1:
 		break;
 	case 0:
-		return NULL;
+		if (revs->boundary) {
+			struct commit_list *list = revs->commits;
+			while (list) {
+				list->item->object.flags |=
+					BOUNDARY_SHOW | BOUNDARY;
+				list = list->next;
+			}
+			revs->max_count = -1;
+			revs->limited = 1;
+		} else
+			return NULL;
 	default:
 		revs->max_count--;
 	}
Next: Junio C Hamano
Message 1 of 3 in “rev-list --max-age, --max-count: support --boundary”
  1. rev-list --max-age, --max-count: support --boundaryJohannes Schindelin, Feb 19, 2007
  2. Junio C HamanoFeb 19, 2007
  3. Johannes SchindelinFeb 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.