Skip to content
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

Buf-breaking fails to clone tag in repo #3215

Closed
micmorris opened this issue Aug 6, 2024 · 2 comments
Closed

Buf-breaking fails to clone tag in repo #3215

micmorris opened this issue Aug 6, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@micmorris
Copy link

GitHub Repository

https://github.com/bufbuild/buf/releases/tag/v1.35.1

Commands

# Run buf-breaking against the last tag in a repo
buf breaking --error-format json --against ".git#ref=$(git describe --abbrev=0)"

Output

Failure: could not clone file:///my/project/path/.git: exit status 1
error: cannot update ref 'refs/heads/v8.0.0': trying to write non-commit object d3f958ff4f77b44a16615a82461ef27e89092315 to branch 'refs/heads/v8.0.0'
From file:///my/project/path/
 ! [new tag]         v8.0.0     -> v8.0.0  (unable to update local ref)
 * [new tag]         v8.0.0     -> v8.0.0

Expected Output

I expected buf breaking to run as it did in previous versions without error.

Anything else?

Apple M1 Pro
OS: Sonoma 14.6
git version 2.46.0 (homebrew)

Before running buf breaking, I am on master branch and ran git fetch -p;git pull;git submodule update --recursive; and additionally git gc --prune=now; git remote prune origin. I've never had a problem running buf breaking like this until v1.35.1

I found a solution to this by just referring to the git commit hash itself, but I think this will still trip people up if they get an obtuse error by referring to a tag. Here's my temp fix:

buf breaking --error-format json --against ".git#ref=$(git describe --abbrev=0 | xargs git rev-list -n 1)"
@micmorris micmorris added the Bug Something isn't working label Aug 6, 2024
@oliversun9
Copy link
Contributor

Hi there, thanks for filing this issue. I believe this is the same as #3197 and the fix will go out in the next release. Apologies for the inconvenience.

@micmorris
Copy link
Author

Ok no problem, thanks!

One administrative suggestion: keep tickets open until the fix actually gets launched, otherwise you'll have many people bringing in duplicate issues after not seeing any active tickets on the issue ;)

Cheers for the quick fix tho!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants