git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexandre Julliard <julliard@winehq.org>
To: Junio C Hamano <junkio@cox.net>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>, git@vger.kernel.org
Subject: Re: Shallow clone
Date: Sat, 11 Nov 2006 14:57:23 +0100	[thread overview]
Message-ID: <87zmaynl18.fsf@wine.dyndns.org> (raw)
In-Reply-To: <7vac31p8om.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Wed\, 08 Nov 2006 20\:04\:25 -0800")

Junio C Hamano <junkio@cox.net> writes:

> But it seems to need some more work.  I just tried to clone
> git.git with --depth=1 and it cauterizes each branch with two
> commits (I think that is what depth=1 means -- the latest and
> one behind it), but it pulled almost the whole repository
> anyway, and it turns out that "git log v1.4.3-rc1" gives me the
> full history leading to it.

That's apparently because tags are not considered when truncating the
commit list. The patch below fixes it, and fetches the right number of
commits for each tag. However the correct fix is probably to not fetch
historical tags at all.

There's also a problem with the packing, a clone --depth 1 currently
results in a pack that's about 3 times as large as it should be.

---
diff --git a/shallow.c b/shallow.c
index 58a7b20..2db1dc4 100644
--- a/shallow.c
+++ b/shallow.c
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "commit.h"
+#include "tag.h"
 
 static int is_shallow = -1;
 
@@ -54,7 +55,7 @@ struct commit_list *get_shallow_commits(
 		if (!commit) {
 			if (i < heads->nr) {
 				commit = (struct commit *)
-					heads->objects[i++].item;
+					deref_tag(heads->objects[i++].item, NULL, 0);
 				if (commit->object.type != OBJ_COMMIT) {
 					commit = NULL;
 					continue;

-- 
Alexandre Julliard

  parent reply	other threads:[~2006-11-11 13:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08  3:21 What's in git.git Junio C Hamano
2006-11-08  4:13 ` David Lang
2006-11-08 16:40   ` Shallow clone [Was Re: What's in git.git ] Aneesh Kumar K.V
2006-11-08 17:59     ` Aneesh Kumar K.V
2006-11-09  4:04       ` Shallow clone Junio C Hamano
2006-11-09  4:17         ` Aneesh Kumar
2006-11-11 13:57         ` Alexandre Julliard [this message]
2006-11-12  8:16           ` Junio C Hamano
2006-11-12 17:59             ` Sergey Vlasov
2006-11-12 21:59               ` Junio C Hamano
2006-11-13  5:29                 ` Junio C Hamano
2006-11-12 13:12       ` Shallow clone [Was Re: What's in git.git ] Petr Baudis
2006-11-12 20:04         ` Shallow clone Junio C Hamano
2006-11-09  2:28   ` What's in git.git Horst H. von Brand
2006-11-09  2:54     ` Junio C Hamano
2006-11-09  3:04       ` Junio C Hamano
2006-11-09  3:45       ` Dave Dillow
2006-11-12 22:25   ` Johannes Schindelin
2006-11-08  7:40 ` Jakub Narebski
2006-11-08  7:59   ` Junio C Hamano
2006-11-08  7:58 ` Jakub Narebski
2006-11-08  8:26   ` Junio C Hamano
2006-11-08 14:51 ` Petr Baudis
2006-11-09  0:02 ` Junio C Hamano
     [not found] <CAEfjWpHhLKpghGRFtzstndk_vYMkLSLAGfXx8agoQmakC-6Otg@mail.gmail.com>
2014-08-19 11:11 ` Fwd: Shallow clone Steven Evergreen
2014-08-19 12:01   ` Duy Nguyen

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zmaynl18.fsf@wine.dyndns.org \
    --to=julliard@winehq.org \
    --cc=aneesh.kumar@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).