All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/4] Make git-fetch follow tags we already have objects for sooner
Date: Fri, 29 Feb 2008 23:25:10 -0500	[thread overview]
Message-ID: <20080301042510.GW8410@spearce.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0802291736580.19665@iabervon.org>

Daniel Barkalow <barkalow@iabervon.org> wrote:
> On Fri, 29 Feb 2008, Shawn O. Pearce wrote:
> 
> > Junio C Hamano <gitster@pobox.com> wrote:
> > > This is cute.  Obviously some tests need to be adjusted for this
> > > change, though.
> > 
> > I'll take a look at the current tests this weekend and see what
> > needs to be adjusted, if anything.  I'd also like to get a few
> > tests written for this, so we are certain the optimizations are
> > kicking in when they are supposed to be.
> 
> I'd be really grateful if you came up with a good general strategy for 
> testing that we're not doing too much work in fetching, because clone has 
> optimizations that I need to test in a similar way, and I haven't been 
> able to think of anything not horribly intrusive.

Is this "horribly intrusive" ?

We can test it with something like this:

  $ GIT_DEBUG_SEND_PACK=1 git fetch 3>UPLOAD_LOG
  $ cat UPLOAD_LOG
  #S
  want 8e10cf4e007ad7e003463c30c34b1050b039db78 multi_ack side-band-64k thin-pack ofs-delta
  want ddfa4a33562179aca1ace2bcc662244a17d0b503
  #E
  #S
  want 3253df4d1cf6fb138b52b1938473bcfec1483223 multi_ack side-band-64k thin-pack ofs-delta
  #E

Notice we made two connections, wanting 2 things and then later
only wanting 1 thing.  Tag auto-following.  :-)

diff --git a/upload-pack.c b/upload-pack.c
index b26d053..4e14020 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -444,7 +444,10 @@ static void receive_needs(void)
 	struct object_array shallows = {0, 0, NULL};
 	static char line[1000];
 	int len, depth = 0;
+	int debug_needs = !!getenv("GIT_DEBUG_SEND_PACK");
 
+	if (debug_needs)
+		write_in_full(3, "#S\n", 3);
 	for (;;) {
 		struct object *o;
 		unsigned char sha1_buf[20];
@@ -452,6 +455,8 @@ static void receive_needs(void)
 		reset_timeout();
 		if (!len)
 			break;
+		if (debug_needs)
+			write_in_full(3, line, len);
 
 		if (!prefixcmp(line, "shallow ")) {
 			unsigned char sha1[20];
@@ -507,6 +512,8 @@ static void receive_needs(void)
 			add_object_array(o, NULL, &want_obj);
 		}
 	}
+	if (debug_needs)
+		write_in_full(3, "#E\n", 3);
 	if (depth == 0 && shallows.nr == 0)
 		return;
 	if (depth > 0) {

-- 
Shawn.

  reply	other threads:[~2008-03-01  4:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  8:42 [PATCH 3/4] Make git-fetch follow tags we already have objects for sooner Shawn O. Pearce
2008-02-29  8:41 ` Junio C Hamano
2008-02-29 22:34   ` Shawn O. Pearce
2008-02-29 22:39     ` Daniel Barkalow
2008-03-01  4:25       ` Shawn O. Pearce [this message]
2008-03-01 16:33         ` Daniel Barkalow
2008-03-02 14:13           ` Shawn O. Pearce

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=20080301042510.GW8410@spearce.org \
    --to=spearce@spearce.org \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.