Skip to content

feat: Add upload-pack for server - #2887

Closed
Ethan (ethanlabstack) wants to merge 3 commits into
GitoxideLabs:mainfrom
ethanlabstack:feat/upload-pack
Closed

feat: Add upload-pack for server#2887
Ethan (ethanlabstack) wants to merge 3 commits into
GitoxideLabs:mainfrom
ethanlabstack:feat/upload-pack

Conversation

@ethanlabstack

Copy link
Copy Markdown

Thanks James Gill (@JamesPatrickGill) for the great start on your PR #2465 .

This is a full replacement, as I have taken a different architectural direction in terms of the layers.

The gix-protocol library is all I need, as I will be handling the HTTPS and SSH termination in the app.

NOTE: I have added a full async version of upload-pack - Sebastian Thiel (@Byron) not sure which way you'd prefer to go here, it could just be like the receive-pack and be pho async - terminating async nicely but then having a common blocking backend.

ALSO I have not added V1 support, happy to add if you require - my research was that we'd be hard pressed to find a client in the wild only supporting V1 these days.


I have added a server in the gix-transport for convenience. It is fairly trivial from there to round that out with gix porcelain for someone who might want to run a server only using gitoxide. I'm not sure what that use case would be so haven't added it. I also haven't given it much attention as I'm not using it.

I've taken on board the comments from #2465 and hope I've landed the 'experimental' flag where you wanted it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a356a3dba

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Comment thread gix/src/transport/builtin_upload_pack.rs Outdated
Comment thread gix-protocol/src/upload_pack.rs Outdated
Ethan (ethanlabstack) and others added 2 commits August 6, 2026 21:54
Co-Authored-By: Oz <oz-agent@warp.dev>
…ct message parsing

Add gix-transport::server with primitives for accepting incoming git
protocol connections:

- ConnectRequest: parsed client connect message (service, path, host, protocol)
- parse_connect_message(): parses git-proto-request format from raw bytes
- Connection<R, W>: bundles packetline reader + writer + connection metadata
- Connection::new(): for HTTP/SSH where setup is handled externally
- accept(): reads first packetline and returns a ready Connection

The blocking_io submodule is gated behind the existing blocking-client
feature flag. The base types and parsing are always available.

Co-authored-by: Kiro <kiro@amazon.com>

feat: add async server-side transport module

Add gix-transport::server::async_io with the async equivalent of the
blocking server connection primitives:

- Connection<R, W>: async packetline reader + writer + metadata
- Connection::new(): for HTTP/SSH where setup is external
- accept(): async version reading first packetline to establish connection

Gated behind the existing async-client feature flag.
Integration tests mirror the blocking_io test suite.

Co-authored-by: Kiro <kiro@amazon.com>
@ethanlabstack Ethan (ethanlabstack) changed the title Add upload-pack feature for server feat: Add upload-pack feature for server Aug 6, 2026
Introduce an `experimental` Cargo feature on the `gix` crate that gates
an in-process `BuiltinUploadPack` transport and `RepositoryDelegate`.
When activated via `--builtin-upload-pack` on clone/fetch for file:// URLs,
this drives `gix-protocol`'s `serve_v2()` directly instead of spawning
an external `git-upload-pack` process.

- Add `experimental` feature to `gix` (enables `gix-protocol/blocking-server`)
- Forward feature in workspace root, included in `max`/`max-pure` only
- Implement `BuiltinUploadPack` transport in `gix/src/transport/`
- Add `--builtin-upload-pack` CLI flag to clone and fetch commands
- Wire flag through gitoxide-core into the connection path
- Add journey test validating equivalence with external upload-pack
- Early-exit error when flag is used without experimental feature compiled in

Co-authored-by: Kiro <kiro@amazon.com>
@ethanlabstack Ethan (ethanlabstack) changed the title feat: Add upload-pack feature for server feat: Add upload-pack for server Aug 6, 2026
@Byron

Copy link
Copy Markdown
Member

Thanks for sharing! And while I am excited to see a server-side happening with the help of gix, I think I finally made up my mind on how to deal with such PRs: Kindly ask to keep them in a fork, while offering to take fixes and supporting modifications into gix- crates if the amount of code remains reviewable.

This means, please have a go in your fork, and as the implementation stabilizes, please do upstream primitives and QoL fixes (and actual bug-fixes) as you see fit. These I can review and merge.

Nowadays maintaining a fork/patchqueue is very straightforward, so I think this should be good for all parties involved.
Thanks for your understanding.

@ethanlabstack

Copy link
Copy Markdown
Author

Thanks for sharing! And while I am excited to see a server-side happening with the help of gix, I think I finally made up my mind on how to deal with such PRs: Kindly ask to keep them in a fork, while offering to take fixes and supporting modifications into gix- crates if the amount of code remains reviewable.

This means, please have a go in your fork, and as the implementation stabilizes, please do upstream primitives and QoL fixes (and actual bug-fixes) as you see fit. These I can review and merge.

Nowadays maintaining a fork/patchqueue is very straightforward, so I think this should be good for all parties involved. Thanks for your understanding.

Hi Sebastian Thiel (@Byron) ,

Yeah it's a massive PR and I wondered how long it would take for you to process it!

So, lets explore this a little.

Firstly, I have three distinct commits - the last two entangle existing code, and I did because the previous PR had/asked for them. The first commit - well, that is the meat, and that is all new code.

So, I can maintain a fork long-term (but merging Cargo lockfiles is not that fun I did that by hand) - if so, I'll just dump the last two commits and keep the upload-pack warm.

The real question - the amount of code is not going to shrink, it's more likely to grow if I keep it. At what point would you consider merging it back into the mothership? Is there some sort of rubric I can aim for ?

Thx

@Byron

Copy link
Copy Markdown
Member

So, I can maintain a fork long-term (but merging Cargo lockfiles is not that fun I did that by hand)

I heard one can use .gitattributes to mark it as binary, so merge will always chose one side or something along these lines. As a generated file, it shouldn't be merged anyway but regenerated.

The real question - the amount of code is not going to shrink, it's more likely to grow if I keep it. At what point would you consider merging it back into the mothership? Is there some sort of rubric I can aim for ?

I don't know - I think I am busy to the end of this year with all the other parts that are missing to get Git3 compatibility and at least a gix 1.0 RC.

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.

2 participants