You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This changes the git ref input to align with the git notion of a ref as
a tag or branch. We now always try to fetch a given ref before falling
back to fetching the HEAD to resolve partial refs. If both a ref and
branch are provided, the branch is fetched directly before resolving the
ref. The inputs `tag` and `commit` can still be used but can now be
replaced by setting the `ref`.
For example:
- Branch `ref=main` will fetch and checkout the `main` branch
- Tag `ref=v1.0.0` will fetch and checkout the `v1.0.0` tag
- Partial `ref=123456` will fetch `HEAD` and checkout `123456`
- Branch with partial `ref=123456,branch=feature` will fetch `feature`
and checkout `123456`
- Commit `ref=<sha>` will fetch `<sha>` and checkout `<sha>`
- Branch with commit `ref=<sha>,branch=feature` with fetch `feature` and
checkout `<sha>`
Fixes#2932
As far as I understand, git branches and tags are types of git refs (they are stored under
.git/refs
).IMO it should therefore be possible to use the
ref
option as a generic way for referencing commits, branches, and tags.This is actually stated in the documentation:
https://buf.build/docs/reference/inputs#other-options
However, while
git checkout remote-tag
is working,buf generate "ssh://git@github.com/path-to-repo.git#ref=remote-tag"
is not.IMO this feature would make parameterizing CI pipelines easier, e.g.:
ssh://git@github.com/path-to-repo.git#ref=develop
- build against latest changes on the develop branchssh://git@github.com/path-to-repo.git#ref=v1.0.0
- build against a stable release tagNote: this is also how kubectl kustomize is implementing the
ref
option:https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md#remote-directories
The text was updated successfully, but these errors were encountered: