{"thread":{"id":"19729","subject":"[JGIT PATCH] Don't log TransportGitSsh error stream to JVM stderr","startedAt":"2009-06-07T22:31:24Z","lastAt":"2009-06-07T22:31:24Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"115748","messageId":"1244413884-17241-1-git-send-email-spearce@spearce.org","threadId":"19729","inReplyTo":null,"subject":"[JGIT PATCH] Don't log TransportGitSsh error stream to JVM stderr","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-06-07T22:31:24Z","receivedAt":"2009-06-07T22:31:24Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This is an API function, not a user interface routine.  We should not\nbe printing messages from the remote side to our console.  Instead we\nshould buffer them, and allow a TransportException to be thrown which\ncontains the message data.  Higher level user interface routines\ncan then catch that exception, and display the message, if any, in\na form that is appropriate to the context.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../spearce/jgit/transport/TransportGitSsh.java    |    7 ++-----\n 1 files changed, 2 insertions(+), 5 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\nindex 2e9e0be..de72d02 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\n@@ -166,17 +166,14 @@ public String toString() {\n \t\t\t@Override\n \t\t\tpublic void write(final int b) throws IOException {\n \t\t\t\tif (b == '\\r') {\n-\t\t\t\t\tSystem.err.print('\\r');\n \t\t\t\t\treturn;\n \t\t\t\t}\n \n \t\t\t\tsb.append((char) b);\n \n \t\t\t\tif (b == '\\n') {\n-\t\t\t\t\tfinal String line = sb.toString();\n-\t\t\t\t\tSystem.err.print(line);\n-\t\t\t\t\tall.append(line);\n-\t\t\t\t\tsb = new StringBuilder();\n+\t\t\t\t\tall.append(sb);\n+\t\t\t\t\tsb.setLength(0);\n \t\t\t\t}\n \t\t\t}\n \t\t};\n-- \n1.6.3.2.322.g117de\n"}]}