git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Stępień" <jstepien@users.sourceforge.net>
To: git@vger.kernel.org
Cc: "Jan Stępień" <jstepien@users.sourceforge.net>
Subject: [PATCH] fetch-pack: make the ssh connection quiet
Date: Wed, 27 Oct 2010 16:27:08 +0200	[thread overview]
Message-ID: <1288189628-4883-1-git-send-email-jstepien@users.sourceforge.net> (raw)

The --quiet option passed to fetch-pack did not affect the ssh child
process. When an ssh server sent a motd it was displayed because the ssh
client wasn't launched with the -q option. This patch makes ssh run quietly
when fetch-pack is called with -q.

An analogous change should be made to other commands which accept --quiet
and connect to remotes using ssh.

Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
---
 builtin/fetch-pack.c |    3 ++-
 cache.h              |    1 +
 connect.c            |    2 ++
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index dbd8b7b..ede1c34 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -876,7 +876,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
 		fd[1] = 1;
 	} else {
 		conn = git_connect(fd, (char *)dest, args.uploadpack,
-				   args.verbose ? CONNECT_VERBOSE : 0);
+				   (args.verbose ? CONNECT_VERBOSE : 0) |
+				   (args.quiet ? CONNECT_QUIET : 0));
 	}
 
 	get_remote_heads(fd[0], &ref, 0, NULL, 0, NULL);
diff --git a/cache.h b/cache.h
index 33decd9..8622a78 100644
--- a/cache.h
+++ b/cache.h
@@ -938,6 +938,7 @@ struct ref {
 extern struct ref *find_ref_by_name(const struct ref *list, const char *name);
 
 #define CONNECT_VERBOSE       (1u << 0)
+#define CONNECT_QUIET         (1u << 1)
 extern char *git_getpass(const char *prompt);
 extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
 extern int finish_connect(struct child_process *conn);
diff --git a/connect.c b/connect.c
index 57dc20c..709601e 100644
--- a/connect.c
+++ b/connect.c
@@ -585,6 +585,8 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
 			*arg++ = putty ? "-P" : "-p";
 			*arg++ = port;
 		}
+		if (!putty && flags & CONNECT_QUIET)
+			*arg++ = "-q";
 		*arg++ = host;
 	}
 	else {
-- 
1.7.0.4

             reply	other threads:[~2010-10-27 14:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 14:27 Jan Stępień [this message]
2010-10-27 15:24 ` [PATCH] fetch-pack: make the ssh connection quiet Drew Northup
2010-10-27 18:40   ` Jan Stępień
2010-10-27 22:35 ` Junio C Hamano
2010-10-28  9:14   ` Jan Stępień

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=1288189628-4883-1-git-send-email-jstepien@users.sourceforge.net \
    --to=jstepien@users.sourceforge.net \
    --cc=git@vger.kernel.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).