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

[PATCH] Re: git-http-pull broken in latest git

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Aug 11, 2005, 23:38 UTC
Message-ID
<Pine.LNX.4.63.0508111929010.12816@iabervon.org>
In-Reply-To
<7v4q9wf4ad.fsf@assigned-by-dhcp.cox.net>
On Thu, 11 Aug 2005, Junio C Hamano wrote:
Show 12 quoted lines
> Petr Baudis <pasky@suse.cz> writes:
> 
> > $ git-cat-file commit bf570303153902ec3d85570ed24515bcf8948848 | grep tree
> > tree 41f10531f1799bbb31a1e0f7652363154ce96f45
> > $ git-read-tree 41f10531f1799bbb31a1e0f7652363154ce96f45
> > fatal: failed to unpack tree object 41f10531f1799bbb31a1e0f7652363154ce96f45
> 
> > Kaboom. I think the issue might be that the reference dependency tree
> > building is broken and it should've pulled the other pack as well.
> 
> Last time I checked, git-http-pull did not utilize the pack
> dependency information, which indeed is wrong. 
Is there documentation on the format?
> When it decides to fetch a pack instead of an asked-for object, it 
> should check which commits the pack expects to have in your local 
> repository and add them to its list of things to slurp.

It should work anyway, except that I messed up some logic in the parallel pull stuff; when it finds it has something already, it ignores it entirely, rather than processing it. The following patch fixes this. --- [PATCH] Fix parallel pull dependancy tracking.

It didn't refetch an object it already had (good), but didn't process it, either (bad). Synchronously process anything you already have.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 pull.c |   57 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 32 insertions(+), 25 deletions(-)
9b6b4b259c6b00d5b2502c158bc800d7623352bc
diff --git a/pull.c b/pull.c
--- a/pull.c
+++ b/pull.c
@@ -98,12 +98,38 @@ static int process_tag(struct tag *tag)
 static struct object_list *process_queue = NULL;
 static struct object_list **process_queue_end = &process_queue;
 
-static int process(unsigned char *sha1, const char *type)
+static int process_object(struct object *obj)
 {
-	struct object *obj;
-	if (has_sha1_file(sha1))
+	if (obj->type == commit_type) {
+		if (process_commit((struct commit *)obj))
+			return -1;
+		return 0;
+	}
+	if (obj->type == tree_type) {
+		if (process_tree((struct tree *)obj))
+			return -1;
 		return 0;
-	obj = lookup_object_type(sha1, type);
+	}
+	if (obj->type == blob_type) {
+		return 0;
+	}
+	if (obj->type == tag_type) {
+		if (process_tag((struct tag *)obj))
+			return -1;
+		return 0;
+	}
+	return error("Unable to determine requirements "
+		     "of type %s for %s",
+		     obj->type, sha1_to_hex(obj->sha1));
+}
+
+static int process(unsigned char *sha1, const char *type)
+{
+	struct object *obj = lookup_object_type(sha1, type);
+	if (has_sha1_file(sha1)) {
+		/* We already have it, so we should scan it now. */
+		return process_object(obj);
+	}
 	if (object_list_contains(process_queue, obj))
 		return 0;
 	object_list_insert(obj, process_queue_end);
@@ -134,27 +160,8 @@ static int loop(void)
 			return -1;
 		if (!obj->type)
 			parse_object(obj->sha1);
-		if (obj->type == commit_type) {
-			if (process_commit((struct commit *)obj))
-				return -1;
-			continue;
-		}
-		if (obj->type == tree_type) {
-			if (process_tree((struct tree *)obj))
-				return -1;
-			continue;
-		}
-		if (obj->type == blob_type) {
-			continue;
-		}
-		if (obj->type == tag_type) {
-			if (process_tag((struct tag *)obj))
-				return -1;
-			continue;
-		}
-		return error("Unable to determine requirements "
-			     "of type %s for %s",
-			     obj->type, sha1_to_hex(obj->sha1));
+		if (process_object(obj))
+			return -1;
 	}
 	return 0;
 }
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 11 in “cg-clone http://www.kernel.org/pub/scm/git/git.git fails”
  1. Dirk BehmeAug 9, 2005
  2. git-http-pull broken in latest gitPetr Baudis, Aug 11, 2005
  3. Junio C HamanoAug 11, 2005
  4. Re: git-http-pull broken in latest gitDaniel Barkalow, Aug 11, 2005
  5. Junio C HamanoAug 12, 2005
  6. Daniel BarkalowAug 12, 2005
  7. Junio C HamanoAug 11, 2005
  8. Petr BaudisAug 12, 2005
  9. Re: git-http-pull broken in latest gitDaniel Barkalow, Aug 12, 2005
  10. Junio C HamanoAug 12, 2005
  11. Daniel BarkalowAug 12, 2005

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.