git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Bill Lear <rael@zopyra.com>
Cc: Jakub Narebski <jnareb@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git-push through git protocol
Date: Sun, 21 Jan 2007 14:00:16 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0701211341300.14248@woody.osdl.org> (raw)
In-Reply-To: <17843.55730.456139.247155@lisa.zopyra.com>



On Sun, 21 Jan 2007, Bill Lear wrote:
>
> I did the steenking testing and it appears to fail.

Ok, I did the test too. It does _appear_ to fail, where the keyword is 
actually the "appear". 

I get

	[torvalds@woody new-repo]$ git push
	updating 'refs/heads/master'
	  from b66385f8f77014d9c3985b1ed1654401508392ad
	  to   2cd693b97b450378fa300ddf6b093aef236953cd
	Generating pack...
	Done counting 4 objects.
	Result has 3 objects.
	Deltifying 3 objects.
	 100% (3/3) done
	Writing 3 objects.
	 100% (3/3) done
	Total 3 (delta 0), reused 0 (delta 0)
	fatal: read error (Bad file descriptor)

On the pushing side, but it all did actually work fine, and trying to push 
again gets you a

	[torvalds@woody new-repo]$ git push
	Everything up-to-date

and the repo I pushed to did get the changes and checks out ok.

So the patch works, but yeah, there's a few issues:

 - the native git:// protocol doesn't open a stream for stderr like ssh 
   does, so all the nice status updates go to the _daemon_ stderr, and on 
   the daemon side I see:

	Unpacking 3 objects
	 100% (3/3) done
	refs/heads/master: b66385f8f77014d9c3985b1ed1654401508392ad -> 2cd693b97b450378fa300ddf6b093aef236953cd

   which might actually be nice from a debugging and logging standpoint, 
   except it doesn't log enough to really be useful.

 - git-send-pack wants expects the status report, and doesn't get one. 
   That, in turn, seems to be because it expects "out" and "in" to be 
   different file descriptors, and with the git:// protocol they aren't 
   (they're the same file descriptor)

This attached patch should fix the second problem. Maybe.

		Linus
---
diff --git a/send-pack.c b/send-pack.c
index cd478dd..3d3ca07 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -327,6 +327,8 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
 	}
 
 	packet_flush(out);
+	if (out == in)
+		out = dup(out);
 	if (new_refs)
 		ret = pack_objects(out, remote_refs);
 	close(out);

  reply	other threads:[~2007-01-21 22:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-21 14:10 git-push through git protocol Bill Lear
2007-01-21 15:27 ` Jakub Narebski
2007-01-21 19:04   ` Linus Torvalds
2007-01-21 20:09     ` Bill Lear
2007-01-21 21:16     ` Johannes Schindelin
2007-01-21 21:22     ` Bill Lear
2007-01-21 22:00       ` Linus Torvalds [this message]
2007-01-22  0:17         ` Linus Torvalds
2007-01-22  0:50           ` Junio C Hamano
2007-01-22  1:10           ` [PATCH] Make sure git_connect() always give two file descriptors Junio C Hamano
2007-01-22  1:47             ` Linus Torvalds
2007-01-22  1:31         ` git-push through git protocol Bill Lear
2007-01-22  1:41           ` Bill Lear
2007-01-22  1:52           ` Linus Torvalds
2007-01-22  2:26             ` Martin Langhoff
2007-01-22  3:01               ` Linus Torvalds
2007-01-22 13:58                 ` Bill Lear
2007-01-22 14:41             ` Bill Lear
2007-01-21 23:49 ` Martin Langhoff
2007-01-22  0:03   ` Bill Lear
2007-01-22  0:24     ` Martin Langhoff
2007-01-22  0:48       ` Jakub Narebski

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=Pine.LNX.4.64.0701211341300.14248@woody.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=rael@zopyra.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 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).