Skip to content

Conversation

bored-engineer
Copy link

@bored-engineer bored-engineer commented Jan 2, 2025

Git's v2 wire protocol defines a few special packets in addition to the existing flush-pkt:

In protocol v2 these special packets will have the following semantics:

  • 0000 Flush Packet (flush-pkt) - indicates the end of a message
  • 0001 Delimiter Packet (delim-pkt) - separates sections of a message
  • 0002 Response End Packet (response-end-pkt) - indicates the end of a response for stateless connections

This PR adds support for reading and writing the delim-pkt and response-end-pkt within the existing plumbing/format/pktline package.

The behavior is kept the same as flush-pkt where Bytes returns an empty slice when these are encountered, but now the "type" of that packet can be determined via the FlushPkt, DelimPkt, ResponseEndPkt methods which return true/false.

@aymanbagabas
Copy link
Member

@bored-engineer Thank you for the PR. V2 wire protocol progress is being tracked in https://github.com/go-git/go-git/tree/v6-exp and https://github.com/go-git/go-git/tree/v6-transport. See https://github.com/go-git/go-git/blob/v6-transport/plumbing/format/pktline/common.go

@github-actions github-actions bot added the stale Issues/PRs that are marked for closure due to inactivity label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues/PRs that are marked for closure due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants