Skip to content

feat: barebones initial server-side upload-pack implementation#2465

Open
JamesPatrickGill wants to merge 14 commits intoGitoxideLabs:mainfrom
JamesPatrickGill:main
Open

feat: barebones initial server-side upload-pack implementation#2465
JamesPatrickGill wants to merge 14 commits intoGitoxideLabs:mainfrom
JamesPatrickGill:main

Conversation

@JamesPatrickGill
Copy link

@JamesPatrickGill JamesPatrickGill commented Mar 10, 2026

tl;dr

I am building a git forge and needed server-side git functionality. I found gitoxide, really liked it and decided to build on it. This is me attempting to upstream it.

I'm happy to rework it and take any feedback!


Hey!

Sorry if me opening this PR out of the blue and is not the process but I have recently started building a small toy git forge in Rust for some fun and when it came to the "git" part I came across gitoxide and really liked it. However, I noticed that the server-side support was not ready for me to build what I wanted, this is my assumption from reading the code anyway.

So I was interested enough to just try to implement it myself and this is what this PR contains. I attempted to go as shallow as possible as to have something to maybe discuss if this is something gitoxide is interested in before I got carried away into all the nitty gritty. That being said it does do some (very little) real stuff:

What is here:

  • gix-transport: Added server-side connection handling: connect message parser and Connection struct
  • gix-protocol: Added server-side upload-pack: ref advertisement writers, wants/haves parser,
    ACK/NAK writers, and upload-pack orchestrators for both protocol versions
  • gix-serve: New crate wiring it together: ref collection from a ref store, pack generation from wanted
    objects, and a top-level serve_upload_pack() entrypoint

There are a lot of caveats though...

Caveats:

  • Ignoring "haves" so servers always send all objects reachable from wants
  • Ignored capabilities for now in the actual serve implementation - they do get parsed though
  • No add-on features supported i.e. shallow-clone etc
  • The pack generation is as naive as it gets, just an unthreaded implementation

However despite being pretty far from done I have an ssh server in my git forge able to serve git clone requests - this can be seen here: https://github.com/JamesPatrickGill/steid


I am very open to guidance and getting this ship shape if you see value. I attempted to match conventions from other crates in the repo as closely as possible.

@JamesPatrickGill JamesPatrickGill changed the title A barebones initial server-side upload-pack implementation feat: barebones initial server-side upload-pack implementation Mar 10, 2026
@JamesPatrickGill JamesPatrickGill force-pushed the main branch 3 times, most recently from 88d083f to 0981434 Compare March 13, 2026 22:28
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.

1 participant