Community
Participate
Working Groups
Created attachment 287018 [details] Proposed patch. org.eclipse.jgit.transport.SideBandOutputStream.progress() in commit 8dad905f20142e699faa974e7bd4cba6ced335cc receives feedback from the git server, breaks it by line and forwards to the reporting facility (doProgressLine()). If the string provided by the git server is not terminated with a new line, the message is suppressed. This leaves the user without information to the cause of the underlying failure. Attached a patch that addresses the issue and uses higher-level and hopefully more transparent String processing features.
- please push your patch to Gerrit [1] for review - add a unit test for the scenario this patch is fixing - JGit is still compiled with Java 8, hence we can't yet use String#lines and String#strip which are available since Java 11, see Bug 569917 [1] https://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches
I have a patch ready, but I cannot register my email with Gerrit, which means I cannot commit. I receive: An error occurred Error 422 (Unprocessable Entity): invalid token Endpoint: /r/config/server/email.confirm The documentation below states the token must be passed as an entity in the request. The email I have received contains it as a link. https://gerrit-documentation.storage.googleapis.com/Documentation/3.1.0/rest-api-config.html#confirm-email I cannot justify investing more time in the byzantine procedure. I will use an internal feature patch and hope some else will fix this in the future. Close wontfix if you like.
I'm not sure changing this would be correct. C git appears to do the same. See code in sideband.c, function demultiplex_sideband(). The bit after the last \r or \n is added to "scratch", but as far as I see it will never be written if no further sideband line is received. The sideband protocol is designed to handle a single line being split over several sideband packets. This change would break that. I do wonder, though, what C git does if the server only sends sideband messages without line terminator... What was the real-world case that prompted this issue?
Perhaps a better approach would be to process any leftover sideband content when the SidebandInputStream is closed.
In our concrete case Gitlab was transferring information about credentials missing to the client. These were immediately copied to stdout in the standard client. I cannot understand how that could happen. Is the protocol parsing for a double line separator? Where is the requisite protocol description?
Is this it? https://git-scm.com/docs/pack-protocol#_pkt_line_format
Specifically, this: https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt
(In reply to Joern Guy Suess from comment #5) > In our concrete case Gitlab was transferring information about credentials > missing to the client. These were immediately copied to stdout in the > standard client. I cannot understand how that could happen. Is the protocol > parsing for a double line separator? Where is the requisite protocol > description? I would suppose that missing credentials is an error and is reported via side-band channel 3, which doesn't even go through this progress reporting on channel 2, and which results in a TransportException being thrown in JGit. C git writes it to stderr.
That does not explain that the patch I have submitted fixes the behaviour we have observed. The debugger also shows this. Never mind. I give up and post a how-to on Stack Overflow so users can understand where this is coming from. Maybe I will offer the patch in an attachment. Will post the SO link here when done. Please abandon the MR.
(In reply to Joern Guy Suess from comment #9) > Please abandon the MR. Done. I'll push early in 6.2 a proper fix based on the idea in comment 4.
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/191926
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/191927
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/191926 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=45287f10978825349be9783950f1d99bc40d5f78
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/191927 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=ac78c175231979c7c5ab361980a233edee7626df