-
Notifications
You must be signed in to change notification settings - Fork 534
No sideband data stored for push #787
Comments
I'm experiencing this as well and I think I know where it comes from. The offending line is plumbing/protocol/packp/report_status.go:77. ReportStatus breaks out on the first flush ( Here's an example response I get from my personal GitLab instance when pushing a branch that is not the default, in which case GL sends a message over band 2 (the verbose band) with a link to immediately create a merge request:
Fully translated to ASCII this is:
I've prepared a gist that breaks the above down byte-by-byte and runs it through the demuxer raw. The demuxer itself handles this correctly, the issue definitely lies somewhere within the status report bits. Comments indicate number of bytes, running total in parentheses, followed by the meaning of those bytes. For the most part this'll just be the ASCII above ;) Gist in question: https://gist.github.com/Werelds/437dc82b0ff755187e44ae61d380663d Note how the first flush is part of the band 1 payload (as in, those 4 bytes are counted towards band 1's length), the last flush however is not part of the payload. I'm going to step through the code with delve a bit to identify exactly where it goes wrong; whether it's the scanner misreading the four zeroes as an empty string (resulting in |
Replace that I took a quick look at the "real" git code and it looks like |
@Werelds We probably missed this. A PR would be welcome, but we'll need to add a specific test for this to verify the change. Thank you! |
@smola I had a go at implementing this a while back (see the PR linked above), but because I'm not that familiar with the project I couldn't figure it all out. Unfortunately I haven't had time to look at it again. In a nutshell though, the problem is one of design. This library doesn't have a single entrypoint to decode incoming streams like Git itself does. It's handled differently for different commands, whereas Git itself simply has a single receiver that sends the bands' data to the appropriate callbacks. It should be easy enough to fix by either using callbacks too or a channel to pass the data on. So rather than |
For reference: both send-pack and fetch-pack use the same recv_sideband. We'd obviously have |
@WEREDS, Thanks! |
Unfortunately, not right now, no! Being the only remaining backend developer in a team has some downsides ;) Hopefully soon I'll have a bit more time again to look at a better solution. I still stand by what I said above: to handle sidebands correctly, the ideal fix should follow Git's example and not attempt to save a few hundred microseconds by not always fully decoding. |
Hi - we'd like to try and find a resolution to this issue. We have a problem where it looks like this is causing a functional issue rather than simply a cosmetic issue of no output being displayed. We have a git server which is configured with some hooks that perform actions when commits are pushed to the server, and the server is returning sideband information to the client while processing the hooks. We see issues with the hooks not being executed which only occur when we are pushing to our server using the go-git library (everything works correctly using the command line git client). Our suspicion is that the client is breaking the connection early (due to the Is someone able to take a look at this? Is PR #821 on the right track? |
This seems like it could be a regression since #573. I haven't been able to see any sideband data for push for a few months now, while clone stores sideband data just fine. I should've reported this earlier, I thought it was user error at first (hey, maybe it still is!)
Steps to reproduce:
Progress: os.Stdout
to the push options in the push example and see no sideband data written toos.Stdout
.os.Stdout
.Let me know if I can provide any more details. Thanks!
The text was updated successfully, but these errors were encountered: