feat: serve non-bare repositories, add --bare-only flag#20
Open
ggueret wants to merge 1 commit into
Open
Conversation
Discovery now records any repository gix can open, not just bare ones, so a directory of working clones can be served for clone/fetch without converting each repo to bare. A recorded repository is no longer descended into, which also avoids walking working-tree noise such as target/ or node_modules/. Pass --bare-only to restore the previous behavior of serving bare repositories exclusively.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Serve repositories that have a working tree, not just bare ones. A new
--bare-onlyflag keeps the previous bare-only behavior.Context
Pointing the server at a directory of ordinary working clones (a dev workspace) discovered nothing, because discovery only recorded bare repositories. The server is read-only (
git-upload-pack), so serving a working-tree repo over HTTP for clone/fetch is safe and fits the local-testing use case.Changes
RepoStore::discoverrecords any repository gix can open (bare or with a working tree) and no longer descends into a recorded repository, so a repo nested in another repo's working tree is not exposed and directories liketarget/ornode_modules/are not walked.--bare-onlyflag (and abare_onlyparameter ondiscover) restores discovery of bare repositories only.myproject) and clonable at/myproject.Test plan
cargo test --workspace: a non-bare repo is discovered; discovery does not descend into a working tree;--bare-onlyskips non-bare repos; an HTTPgit cloneof a non-bare repo succeeds.git-server ~/Projectsdiscovers the working repos;git-server ~/Projects --bare-onlydiscovers none.