this should work right, or did the syntax change: · Entire
Introduction
This should work right, or did the syntax change:
❯ go run ./cmd/git-sync sync
Flags:
--protocol v2--measure-memory-v--target-username git--target-insecure-skip-tls-verify--tags
Example URLs:
Error Message
error: list target refs: pkt-line 1: cannot read hash, pkt-line too short (# service=git-receive-pack)
exit status 1
Debugging Steps
- Checking the current CLI and sync path in this repo.
- Tracing the origin of the
git-receive-packpkt-line error to determine if it's due to syntax or protocol behavior. - Confirming that flags are still valid and checking for target ref discovery issues.
Additional Details
- The target is always queried via v1
receive-packdiscovery regardless of--protocol v2applied to the source side. - Issue may stem from unexpected
info/refs?service=git-receive-packresponses. - Valid command syntax confirmed; however, further checks needed on the target endpoint handling.
Notes on Workflows
- It's important to ensure that the target URL points to a valid Git smart-HTTP endpoint.
- Likewise, checking that authentication for the target repo is configured properly is crucial.
Candidate Changes to Investigate
- Target Discovery: Inspect changes in the target discovery mechanism following codebase rewrites.
- Decoder Logic: Ensure the decoding logic is robust against empty or unexpected advertisement shapes.
Conclusion
If issues persist regarding the target receive-pack advertisement, logging improvements should be implemented to show the first bytes of any malformed response to expedite debugging.