Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor transport and cleanup #938

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aymanbagabas
Copy link
Contributor

@aymanbagabas aymanbagabas commented Nov 22, 2023

The transport sub-package is a fundamental part of the Go-Git project. Like Git, Go-Git supports the file, git, ssh, and HTTP transports. The file, git, and ssh transports use a shared full-duplex transfer protocol that can read/write on the same connection. HTTP on the other hand, uses a different implementation that uses a half-duplex but still with many common parts with the original transfer protocol.

TODO:

  • Refactor pktline Pktline rewrite aymanbagabas/go-git#1
    • Clean up and DRY implementation
    • Replace Encoder/Scanner with static methods
    • Support Peek
    • Improve performance
  • Restructure shared packages and code for more efficiency
    • Move common transport to plumbing/transport
    • Move server transport and logic to plumbing/server
  • Remove file transport external binary dependency
  • Use intuitive names and be consistent with the Git documentation (e.g. packp struct fields)
  • Separate client/server logic
  • Use transport registry to be able to register new transports
  • Come up with a new abstracted transport API that can work with protocol v2 (Added initial support for git wire protocol v2  #876) (Proposed API) Refactor transport API aymanbagabas/go-git#2

@aymanbagabas aymanbagabas force-pushed the transport-refactor branch 9 times, most recently from 34c00a3 to 755a2fd Compare November 22, 2023 20:30
@aymanbagabas aymanbagabas force-pushed the transport-refactor branch 2 times, most recently from 48df491 to 4ba86f9 Compare November 29, 2023 00:04
aymanbagabas and others added 3 commits April 23, 2024 12:19
Git file, git, and ssh transports use a full-duplex transport protocol.
This is now located under `plumbing/transport`.
The server transport along with its `Serve*` methods are now located
under `plumbing/server`.
* plumbing: pktline, dry parsing length and rename empty pkt

* plumbing: pktline, implement pktline reader

* plumbing: pktline, implement pktline writer

* plumbing: pktline tests, add benchmarks

* plumbing: pktline, deprecate the old impl and use pktline read/writer

* plumbing: pktline, use static methods approach

* plumbing: pktline, add WriteResponseEnd and method docs

* plumbing: pktline, remove scanner/encoder

* plumbing: pktline, update comment

* plumbing: pktline, add benchmark tests

* plumbing: pktline, error on nil writer

* plumbing: pktline, update plumbing/protocol/packp/uppackresp.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

* plumbing: pktline, update plumbing/protocol/packp/report_status.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

* plumbing: pktline, update plumbing/protocol/packp/report_status.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

* plumbing: pktline, update plumbing/protocol/packp/gitproto.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

* plumbing: pktline, update plumbing/format/pktline/pktline_bench_test.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

* plumbing: packp, update imports

* plumbing: pktline, add GetPacketBuffer and PutPacketBuffer

* plumbing: pktline, use shared buffer with ReadPacketLine

* plumbing: pktline, add scanner based type

* plumbing: pktline, update benchmarks

* plumbing: pktline, fix errors and improve perf and memory

* plumbing: pktline, shorten method names

Pktline is already implied in the package name, no need to have "Packet"
in the method names.

* plumbing: pktline, update plumbing/protocol/packp/advrefs_decode.go

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>

---------

Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant