git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	git@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] upload-pack: squelch progress indicator if client does not request sideband
Date: Tue, 16 Jun 2009 20:41:16 +0200	[thread overview]
Message-ID: <200906162041.16608.j6t@kdbg.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0906161354010.16467@xanadu.home>

On Dienstag, 16. Juni 2009, Nicolas Pitre wrote:
> On Mon, 15 Jun 2009, Junio C Hamano wrote:
> > Stated differently, I think "not using sideband _and_ spawned via daemon"
> > would be an indication that "the client won't see the progress anyway
> > even if it were sent."  So the question becomes "will it be a small
> > enough change to detect if the upload-pack is driven by the daemon in the
> > codepath J6t added 'if (!use_sideband)' to, and if so shouldn't we do
> > so?"
>
> I don't think it is worth it at all.  The regression is purely cosmetic,
> and I suspect you'll have a really hard time finding someone still using
> those ancient git clients anyway.  Remember that such clients are unable
> to fetch with HTTP from repositories using version 2 of the pack index
> by default already.  That's why we created version 1.4.4.5.

Keep in mind that there could exist clients outside git.git that use modern
pack-index or unpack-objects, but omit sideband support.

I propose this patch instead, although the assumption that the --timeout
option is only used by git-daemon may not be quite right. In this case it
may be better to add a new option that sets the new flag and that
git-daemon has to use.

-- Hannes

Subject: [PATCH] upload-pack: squelch progress indicator if client cannot see it

upload-pack runs pack-objects, which generates progress indicator output
on its stderr. If the client requests a sideband, this indicator is sent
to the client; but if it did not, then the progress is written to
upload-pack's own stderr.

If upload-pack is itself run from git-daemon (and if the client did not
request a sideband) the progress indicator never reaches the client and it
need not be generated in the first place. With this patch the progress
indicator is suppressed in this situation.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 upload-pack.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/upload-pack.c b/upload-pack.c
index edc7861..841ebb5 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -28,7 +28,7 @@ static unsigned long oldest_have;
 
 static int multi_ack, nr_our_refs;
 static int use_thin_pack, use_ofs_delta, use_include_tag;
-static int no_progress;
+static int no_progress, daemon_mode;
 static struct object_array have_obj;
 static struct object_array want_obj;
 static unsigned int timeout;
@@ -521,6 +521,10 @@ static void receive_needs(void)
 	}
 	if (debug_fd)
 		write_in_full(debug_fd, "#E\n", 3);
+
+	if (!use_sideband && daemon_mode)
+		no_progress = 1;
+
 	if (depth == 0 && shallows.nr == 0)
 		return;
 	if (depth > 0) {
@@ -630,6 +634,7 @@ int main(int argc, char **argv)
 		}
 		if (!prefixcmp(arg, "--timeout=")) {
 			timeout = atoi(arg+10);
+			daemon_mode = 1;
 			continue;
 		}
 		if (!strcmp(arg, "--")) {
-- 
1.6.3.17.g1665f

  reply	other threads:[~2009-06-16 18:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 20:38 [PATCH] daemon: send stderr of service programs to the syslog Johannes Sixt
2009-06-15 14:57 ` Shawn O. Pearce
2009-06-15 15:34   ` Nicolas Pitre
2009-06-15 19:06   ` H. Peter Anvin
2009-06-15 21:24   ` [PATCH] upload-pack: squelch progress indicator if client does not request sideband Johannes Sixt
2009-06-15 21:53     ` Junio C Hamano
2009-06-16  1:16       ` Nicolas Pitre
2009-06-16  5:02         ` Junio C Hamano
2009-06-16 18:03           ` Nicolas Pitre
2009-06-16 18:41             ` Johannes Sixt [this message]
2009-06-16 18:57               ` Junio C Hamano
2009-06-16 19:46               ` Nicolas Pitre
2009-06-15 21:39 ` [PATCH] daemon: send stderr of service programs to the syslog Johannes Sixt
2009-06-15 21:43   ` H. Peter Anvin
2009-06-16 20:27     ` Johannes Sixt
2009-06-16 20:30       ` H. Peter Anvin
2009-06-19 20:26 ` Junio C Hamano
2009-06-20 19:25   ` Johannes Sixt

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=200906162041.16608.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hpa@zytor.com \
    --cc=nico@cam.org \
    --cc=spearce@spearce.org \
    /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).