Skip to content

docs: Add transport options and authentication to v5-to-v6 guide - #12

Open
JonathanYuan23 wants to merge 1 commit into
go-git:mainfrom
JonathanYuan23:docs/v6-transport-options
Open

JonathanYuan23 wants to merge 1 commit into
go-git:mainfrom
JonathanYuan23:docs/v6-transport-options

Conversation

@JonathanYuan23

Copy link
Copy Markdown

v6 replaced:

  • Auth
  • InsecureSkipTLS
  • CABundle
  • ProxyOptions
  • client.InstallProtocol

with ClientOptions []client.Option.

This PR adds a mapping table and before/after examples.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

v6 replaced Auth, InsecureSkipTLS, CABundle, ProxyOptions and
client.InstallProtocol with ClientOptions []client.Option. Add a
mapping table and before/after examples, and note that WithCABundle
now trusts only the given CAs.

Signed-off-by: Jonathan Yuan <jy90023@gmail.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 insufficient remaining quota. Try requesting a review at a lower effort level.

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@JonathanYuan23 thanks for looking into this. Here's some feedback:

The mapping table, the CABundle behaviour-change callout and the WithHTTPClient caveat all match what's on main. Some suggestions, checked against 9decb13c:

Correction

  • "The authentication types themselves are unchanged" is only true for code that constructs them. The types themselves changed:
    • SSH auth types (PublicKeys, Password, KeyboardInteractive, PasswordCallback, PublicKeysCallback) lost the HostKeyAlgorithms field and the Name()/String() methods, and ClientConfig() became ClientConfig(ctx, *transport.Request).
    • http.BasicAuth/TokenAuth lost SetAuth, Name and String, and gained Authorizer.

Let's add: "Constructing the auth types is unchanged … custom auth implementations and code that set HostKeyAlgorithms need updating."

Missing migrations

  • mTLS. v5's ClientCert/ClientKey aren't in the checklist or the table, and there's no client.With… equivalent. The current workaround is client.WithHTTPClient(c) with TLSClientConfig.Certificates set, or client.WithTransport("https", http.NewTransport(http.Options{TLS: …})). Worth a row and a short example.

Small improvements

  • The "build the option slice once and reuse it" tip: each operation still builds a new client and HTTP connection pool. If connection reuse matters, users should pass their own *http.Client with WithHTTPClient. Worth one line.
  • WithHTTPClient applies to both http and https, while v5's InstallProtocol("https", …) covered only https. A minor difference, but users who installed different clients per scheme will notice.

Elsewhere in the guide

These are outside this PR, but the new note in section 14 draws attention to them.

  • Section 14 says only the client side has merged. The server side is on main too: plumbing/transport/server is gone, replaced by transport.UploadPack/ReceivePack/UploadArchive and the new backend package. transport/client, transport/test and serverinfo were removed as well.
  • Section 12 (SHA-256) is listed as Planned, but it is on main. Points to cover:
    • plumbing.Hash is now an alias of the struct ObjectID, so code that indexes, slices or converts hashes to [20]byte no longer compiles.
    • == plumbing.ZeroHash still compiles but is wrong for SHA-256 ids; IsZero() is the safe check.

This branch has not been deployed

No deployments
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.

3 participants