git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH] upload-pack: squelch progress indicator if client does not request sideband
Date: Mon, 15 Jun 2009 23:24:43 +0200	[thread overview]
Message-ID: <200906152324.43435.j6t@kdbg.org> (raw)
In-Reply-To: <20090615145716.GW16497@spearce.org>

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.

Since the previous patch git-daemon monitors stderr of the service program,
such as upload-pack, and copies it to the syslog. This would now also copy
the progress indicator to the syslog. We avoid this by calling pack-objects
without --progress if there is no sideband channel to the client.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
On Montag, 15. Juni 2009, Shawn O. Pearce wrote:
> IIRC only upload-pack produces progress (from pack-objects).
> It does so by using a pipe on fd 2, and either copying it down
> to the client via side-band, or discarding it.  So progress data
> shouldn't ever appear on upload-pack's own fd 2, which means you
> won't get it in this syslog thing.

Unfortunately, upload-pack *does* write the progress to fd 2,
and this fixes it.

-- Hannes

 upload-pack.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/upload-pack.c b/upload-pack.c
index edc7861..fef8be5 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -521,6 +521,15 @@ static void receive_needs(void)
 	}
 	if (debug_fd)
 		write_in_full(debug_fd, "#E\n", 3);
+
+	/*
+	 * If upload-pack is run from the daemon and the client did not
+	 * request a sideband, the progress output produced by pack-objects
+	 * would go to the syslog. Squelch it.
+	 */
+	if (!use_sideband)
+		no_progress = 1;
+
 	if (depth == 0 && shallows.nr == 0)
 		return;
 	if (depth > 0) {
-- 
1.6.3.17.g1665f

  parent reply	other threads:[~2009-06-15 21:25 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   ` Johannes Sixt [this message]
2009-06-15 21:53     ` [PATCH] upload-pack: squelch progress indicator if client does not request sideband 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
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=200906152324.43435.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hpa@zytor.com \
    --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).