Skip to content

feat: Support pseudo-versions in Go module proxy#187

Merged
alecthomas merged 3 commits intoblock:mainfrom
bwester:bwester/pseudo-versions
Mar 17, 2026
Merged

feat: Support pseudo-versions in Go module proxy#187
alecthomas merged 3 commits intoblock:mainfrom
bwester:bwester/pseudo-versions

Conversation

@bwester
Copy link
Copy Markdown
Contributor

@bwester bwester commented Mar 13, 2026

Go allows module versions to be specified as a pesudo-version string,
like "v0.0.0-20191109021931-daa7c04131f5". This commit adds support to
the Go private module fetcher to extract and use the git object name
when handling a pseudo-version provided by a client.

Go allows module versions to be specified as a pesudo-version string,
like "v0.0.0-20191109021931-daa7c04131f5". This commit adds support to
the Go private module fetcher to extract and use the git object name
when handling a pseudo-version provided by a client.
@bwester bwester requested a review from a team as a code owner March 13, 2026 02:58
@bwester bwester requested review from worstell and removed request for a team March 13, 2026 02:58
return nil, errors.Wrapf(err, "git clone: %s", string(output))
}
// #nosec G204 - cloneDir and gitRef are controlled by us
cmd = exec.CommandContext(ctx, "git", "-C", cloneDir, "checkout", gitRef)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
cmd = exec.CommandContext(ctx, "git", "-C", cloneDir, "checkout", gitRef)
cmd = exec.CommandContext(ctx, "git", "-C", cloneDir, "checkout", "--", gitRef)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If I add --, git will attempt restore the file named by gitRef with its version from the index. I instead want it to checkout files name by an object reference. The command is correct as-is.

@bwester
Copy link
Copy Markdown
Contributor Author

bwester commented Mar 17, 2026

@worstell, can you merge this PR? I do not have access to do that myself even with an approval.

@alecthomas alecthomas merged commit 2506cb9 into block:main Mar 17, 2026
6 checks passed
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