Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Can we read the message as a stream while pushing to server?

On Fri, Jan 11, 2013 at 6:27 AM, André Dietisheim <adietish@xxxxxxxxxx> wrote:
> I spotted the messages being written to MessageWriter while they come in from the backend.
> In case of ssh-connection I see in SshPushConnection#doPush:
>
> <snip>
> if (capableSideBand) {
>   int b = in.read();
> </snip>
>
> "in" is a SideBandInputStream which writes the messages to the
> MessageWriter in SideBandInputStream#doProgressLine.
>
> <snip>
> messages.write(msg);
> </snip>
>
>
> The current implementation of the PushProcess gets the messages (as concatenated string)
> from the MessageWriter once the push is finished, PushProcess#execute:
>
> <snip>
> } finally {
>   connection.close();
>   res.addMessages(connection.getMessages());
> }
> </snip>
>
> Assuming my understanding is correct,

The above is correct.

> I'd make sure I can pass the messageWriter my very own OutputStream so that he can write the
> messages to it. That would allow me to show them in the Eclipse Console (or some dialog) as
> they come in.

Right. You need to modify the transport API to support passing in an
OutputStream so JGit can send to your stream, rather than its buffer.


Back to the top