From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg@dewire.com>
Cc: git@vger.kernel.org, Marek Zawirski <marek.zawirski@gmail.com>
Subject: Re: [PATCH] Take care of errors reported from the server when upload command is started
Date: Sun, 22 Jun 2008 19:01:59 -0400 [thread overview]
Message-ID: <20080622230159.GG11793@spearce.org> (raw)
In-Reply-To: <1214156797-29186-1-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> @@ -44,4 +46,31 @@ class EclipseSshSessionFactory extends SshSessionFactory {
> + @Override
> + public OutputStream getErrorStream() {
...
> + Activator.logError(s, new Throwable());
I'm not sure what value the Throwable gives us here; it may be some
call stack deep within JSch, isn't it? Is it useful to include?
We may also want the log records in Eclipse to say which remote the
message came from, which means passing in the URIish as a parameter.
> @@ -77,6 +78,7 @@ class TransportGitSsh extends PackTransport {
> }
>
> final SshSessionFactory sch;
> + OutputStream errStream;
Could we avoid putting the error stream as an instance member
of the transport by instead using channel.getErrStream() in the
exception case below?
> @@ -179,7 +181,8 @@ class TransportGitSsh extends PackTransport {
> cmd.append(' ');
> sqAlways(cmd, path);
> channel.setCommand(cmd.toString());
> - channel.setErrStream(System.err);
> + errStream = SshSessionFactory.getInstance().getErrorStream();
Use sch rather than SshSessionFactory.getInstance(). We store it in the
transport so that once the transport instance is created it always goes
to the same SshSessionFactory for anything it needs, even if the caller
has changed the global SshSessionFactory away on us.
> @@ -198,7 +201,12 @@ class TransportGitSsh extends PackTransport {
> try {
> session = openSession();
> channel = exec(session, getOptionUploadPack());
> - init(channel.getInputStream(), channel.getOutputStream());
> +
> + if (channel.isConnected())
> + init(channel.getInputStream(), channel.getOutputStream());
> + else
> + throw new TransportException(errStream.toString());
I think you can say channel.getErrStream() here and not need the
instance member.
--
Shawn.
next prev parent reply other threads:[~2008-06-22 23:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-22 1:36 [jgit PATCH] Paper bag fix quoting for SSH transport commands Shawn O. Pearce
2008-06-22 17:46 ` [PATCH] Take care of errors reported from the server when upload command is started Robin Rosenberg
2008-06-22 17:46 ` [PATCH] Clone: Handle cancel in clone dialog specially Robin Rosenberg
2008-06-22 17:46 ` [PATCH] Clone: If url is changed was changed, forget the old value Robin Rosenberg
2008-06-22 23:01 ` Shawn O. Pearce [this message]
2008-06-22 17:54 ` [jgit PATCH] Paper bag fix quoting for SSH transport commands Robin Rosenberg
2008-06-22 22:15 ` Shawn O. Pearce
2008-06-23 2:30 ` Robin Rosenberg
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=20080622230159.GG11793@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=marek.zawirski@gmail.com \
--cc=robin.rosenberg@dewire.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.