GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — plumbing: transport, add git-upload-archive support by aymanbagabas · Pull Request #1986 · go-git/go-git Conversation
Member
This PR adds support for the BackgroundThe ChangesClient-Side TypesArchiver interface - Sessions that implement this can perform archive operations: type Archiver interface { Archive(ctx context.Context, req *ArchiveRequest) (io.ReadCloser, error) } ArchiveRequest - Client archive request:
Server-Side TypesUploadArchiveRequest - Server archive request configuration:
UploadArchive function - Server-side handler for the git-upload-archive protocol. Backend SupportSSH/TCP/Unix transports - Backend now dispatches to case transport.UploadArchiveService: return transport.UploadArchive(...) HTTP - Left for future protocol-v2 work (HTTP archive requires command-based protocol) Wire ProtocolImplements the git-upload-archive protocol:
Supported FormatsSupported formats parsed from args:
Testing
All tests verify archive contents against git's output. SecurityThe Follow-up WorkA future PR will add porcelain-level support:
Usage Examplesess, _ := client.Dial("[email protected]:go-git/go-git.git") req := &transport.ArchiveRequest{ Args: []string{"--format=tar.gz", "--prefix=go-git/", "v5.12.0"}, } rc, _ := sess.Archive(ctx, req) defer rc.Close() // Write rc to file or pipe to tar/gzip Supersedes: #1985
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
aymanbagabas
commented
Comment on lines
+27
to
+36
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is usually derived from global/system config then overridden by repository config. Alternatively, we'd use config.LoadConfig. cc/ @pjbgf
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's start with the current
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, I will drop this option and add a comment to investigate this later and derive it from global/system config before repository config.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
pjbgf
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aymanbagabas thanks for looking into this, here's some feedback:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+27
to
+36
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's start with the current
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we are missing this:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
aymanbagabas
force-pushed
the
transport-archive
branch
from
73b8fc0 to
174aa08
Compare
aymanbagabas
force-pushed
the
transport-archive
branch
2 times, most recently
from
5ef59da to
cebfcdd
Compare
pjbgf
reviewed
Uh oh!
There was an error while loading. Please reload this page.
aymanbagabas
force-pushed
the
transport-archive
branch
from
8106cd2 to
6fa62ef
Compare
Add git-upload-archive service support to transport layer. This allows fetching archives (tarballs) from remote git repositories over various transports (SSH, HTTP, and local file). Expose new Archivable interface via transport.Session and implement: - ArchiveRequest type for archive configuration (format, compression, prefix) - UploadArchiveRequest/UploadArchive types for wire protocol - Support for archive filters (tree and commit filters) - Backend dispatch for SSH/TCP/Unix transports - Tests for file, git, and SSH transports HTTP backend support left for future protocol-v2 work. The previous implementation was losing file permission details by converting all files to either 0o644 or 0o755, discarding the actual git mode bits including group-writable. Added applyUmask() functions that extract Unix permission bits from the git mode and apply the default umask (0o002) following canonical git's tar.umask behavior. This preserves the original file permissions from the tree being archived. Also added tests to verify file permissions are correctly preserved in both tar and zip archives. … position for paths …at rely on shared fixture state Signed-off-by: Paulo Gomes <[email protected]> Signed-off-by: Paulo Gomes <[email protected]> Signed-off-by: Paulo Gomes <[email protected]> Signed-off-by: Paulo Gomes <[email protected]> Signed-off-by: Paulo Gomes <[email protected]> Signed-off-by: Paulo Gomes <[email protected]>
pjbgf
force-pushed
the
transport-archive
branch
from
6fa62ef to
4928734
Compare
Signed-off-by: Paulo Gomes <[email protected]>
pjbgf
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aymanbagabas thanks for the great effort putting this together. 🙇🙇🙇
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reviewers
Copilot code review
Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |