git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Harkes <jaharkes@cs.cmu.edu>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Continue traversal when rev-list --unpacked finds a packed commit.
Date: Mon, 30 Oct 2006 20:37:49 -0500	[thread overview]
Message-ID: <20061031013749.GA19885@delft.aura.cs.cmu.edu> (raw)
In-Reply-To: <7vhcxltmit.fsf@assigned-by-dhcp.cox.net>


When getting the list of all unpacked objects by walking the commit history,
we would stop traversal whenever we hit a packed commit. However the fact
that we found a packed commit does not guarantee that all previous commits
are also packed. As a result the commit walkers did not show all reachable
unpacked objects.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
---
 revision.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/revision.c b/revision.c
index 280e92b..a69c873 100644
--- a/revision.c
+++ b/revision.c
@@ -418,9 +418,6 @@ static void limit_list(struct rev_info *
 
 		if (revs->max_age != -1 && (commit->date < revs->max_age))
 			obj->flags |= UNINTERESTING;
-		if (revs->unpacked &&
-		    has_sha1_pack(obj->sha1, revs->ignore_packed))
-			obj->flags |= UNINTERESTING;
 		add_parents_to_list(revs, commit, &list);
 		if (obj->flags & UNINTERESTING) {
 			mark_parents_uninteresting(commit);
@@ -1149,17 +1146,18 @@ struct commit *get_revision(struct rev_i
 		 * that we'd otherwise have done in limit_list().
 		 */
 		if (!revs->limited) {
-			if ((revs->unpacked &&
-			     has_sha1_pack(commit->object.sha1,
-					   revs->ignore_packed)) ||
-			    (revs->max_age != -1 &&
-			     (commit->date < revs->max_age)))
+			if (revs->max_age != -1 &&
+			    (commit->date < revs->max_age))
 				continue;
 			add_parents_to_list(revs, commit, &revs->commits);
 		}
 		if (commit->object.flags & SHOWN)
 			continue;
 
+		if (revs->unpacked && has_sha1_pack(commit->object.sha1,
+						    revs->ignore_packed))
+		    continue;
+
 		/* We want to show boundary commits only when their
 		 * children are shown.  When path-limiter is in effect,
 		 * rewrite_parents() drops some commits from getting shown,
-- 
1.4.2.4.gd5de

  reply	other threads:[~2006-10-31  1:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29  9:37 [PATCH 2/3] Only repack active packs by skipping over kept packs Shawn Pearce
2006-10-30 19:07 ` WARNING: THIS PATCH CAN BREAK YOUR REPO, was " Nicolas Pitre
2006-10-30 19:23   ` Shawn Pearce
2006-10-30 20:26   ` Shawn Pearce
2006-10-30 20:52     ` Jan Harkes
2006-10-30 21:07       ` Jan Harkes
2006-10-30 21:09       ` Shawn Pearce
2006-10-30 21:59       ` Junio C Hamano
2006-10-30 22:54         ` Junio C Hamano
2006-10-30 22:55         ` Jan Harkes
2006-10-30 23:24           ` Junio C Hamano
2006-10-31  1:37             ` Jan Harkes [this message]
2006-10-31  1:47               ` [PATCH] Continue traversal when rev-list --unpacked finds a packed commit Junio C Hamano
2006-10-31  2:17                 ` Jan Harkes
2006-10-30 21:48     ` WARNING: THIS PATCH CAN BREAK YOUR REPO, was Re: [PATCH 2/3] Only repack active packs by skipping over kept packs Junio C Hamano
2006-10-30 21:55       ` Shawn Pearce
2006-10-30 22:07         ` Junio C Hamano

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=20061031013749.GA19885@delft.aura.cs.cmu.edu \
    --to=jaharkes@cs.cmu.edu \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).