-
Notifications
You must be signed in to change notification settings - Fork 869
[v6-exp] Consolidate in-flight changes #1166
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
Conversation
go-git does not support concurrency. In some cases, read concurrency may lead to repositories becoming corrupted or actions to yield invalid results (e.g. not finding an existing ref). This commit is an initial attempt to start supporting read concurrency. Some initial use cases that seem to be enabled by these changes: - repository.CommitObjects().Foreach() - repository.Tags().Foreach() - commit.IsAncestor() The mutex objects that were introduced must be expanded other parts of the code base affected, and some performance off-setting is planned to take place. Both will be tackled in follow-up commits. Signed-off-by: Paulo Gomes <[email protected]>
The implementation of the v2 wire protocol will require that the protocol can be set and shared amongst different parts of the code base. This change introduces the config support for managing protocol.version but more importantly introduces the Version type in plumbing/protocol. Signed-off-by: Paulo Gomes <[email protected]>
The BoundOS further aligns go-git with the upstream behaviour, removing suprises that generally catch go-git users off-guard. For more information refer to go-billy's docs: https://github.com/go-git/go-billy/blob/69f6dc8f11964f3aafa2a7a0be6db030ad43ecf4/osfs/os_bound.go#L32-L42 Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
aymanbagabas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some minor design comments
config/config.go
Outdated
| // using the specified protocol version. If the server does not | ||
| // support it, communication falls back to version 0. If unset, | ||
| // the default is 2. Supported versions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // using the specified protocol version. If the server does not | |
| // support it, communication falls back to version 0. If unset, | |
| // the default is 2. Supported versions: | |
| // using the specified protocol version. If the server does not | |
| // support it, communication falls back to version 0. If unset, | |
| // the default version will be used. Supported versions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support depends on the implementation of both client and server.
config/config.go
Outdated
| // should be marshalled or not. | ||
| // Note that this does not need to align with the default protocol | ||
| // version from plumbing/protocol. | ||
| DefaultProtocolVersion = protocol.Unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DefaultProtocolVersion = protocol.Unknown | |
| DefaultProtocolVersion = protocol.V0 // go-git only supports V0 for the moment |
| // 0 - the original wire protocol. | ||
| // 1 - the original wire protocol with the addition of a | ||
| // version string in the initial response from the server. | ||
| // 2 - Wire protocol version 2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, go-git only supports V0 as of now
plumbing/protocol/version.go
Outdated
| type Version int | ||
|
|
||
| const ( | ||
| Unknown Version = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Unknown Version = -1 | |
| Undefined Version = -1 |
Perhaps Undefined signifies the intention better
|
|
||
| // Override http(s) default protocol to use our custom client | ||
| client.InstallProtocol("https", githttp.NewClient(customClient)) | ||
| transport.Register("https", githttp.NewClient(customClient)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:chefkiss:
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
|
@pjbgf Thinking more about |
|
@aymanbagabas good point. I think we are better positioned to review the mechanics around this during the implementation of newer protocol versions, so we can test it E2E. I am aiming to work on this soonish - just trying to get other minor changes on v6-exp out of the way first. |
A few changes aimed at the
v6-expbranch were floating around different branches. This PR consolidates those changes so that those other branches can be deleted.Changes of note:
osfs.BoundOSthe defaultosfs(fixes Symlinks pointing outside repository are mangled with PlainOpen #1155).