Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/vgo: issue with Git LFS #25605
What version of Go are you using (
Hi @ttaylorr. I tried with the latest version of Git LFS, and seem to get the same error. Thanks for looking at this.
Edit: Contents of
Without git-lfs installed on my machine, everything is working fine. I imagine that's expected, and that vgo is somehow using git-lfs in an unexpected way. I am going to send out a change to vgo to make -x show all git commands it runs, but I can tell you right now that these are the commands it runs in that repo:
It's that last git archive that fails, of course. It seems unlikely that the log and cat-file commands matter, but that's all of them. I wonder if the problem has to do with being a bare repo, and on top of that one not created by clone?
@mewmew, maybe it's worth trying those commands by hand, outside of vgo?
@rsc I very much appreciate the
In this case, when
I think that this can be resolved by teaching vgo to first add a remote for any non-local repository it's interested in, and then use that remote instead of a URL. In practice:
--- vgo 2018-06-06 12:27:32.000000000 -0700 +++ vgo-remote 2018-06-06 12:28:02.000000000 -0700 @@ -1,6 +1,7 @@ mkdir -p /tmp/foo/src/v/cache/vcswork/33d7fd8670cc26328c70a1aa2e256f39e8677b5051ce504802f38deaa8cce53c cd /tmp/foo/src/v/cache/vcswork/33d7fd8670cc26328c70a1aa2e256f39e8677b5051ce504802f38deaa8cce53c git init --bare +git remote add origin https://github.com/azul3d/engine -git ls-remote -q https://github.com/azul3d/engine +git ls-remote -q origin git log -n1 --format=format:%H eb48fbeb6d97 -git fetch https://github.com/azul3d/engine +git fetch origin
If this is an approach that you think would be OK for vgo, I would be happy to write a patch to that effect.
@rsc wonderful, CL 116758 works great for me:
# (in vgo) $ git show --oneline -q HEAD 426db6d (HEAD -> master) cmd/go/internal/modfetch/gitrepo: fix problem with Git LFS $ git clone https://github.com/mewkiz/flac # ... # (in mewkiz/flac.git) $ vgo build ./... vgo: creating new go.mod: module github.com/mewkiz/flac vgo: resolving import "github.com/icza/bitio" vgo: finding github.com/icza/bitio (latest) vgo: adding github.com/icza/bitio v0.0.0-20180221120200-b25b30b42508 vgo: resolving import "github.com/mewkiz/pkg/errutil" vgo: finding github.com/mewkiz/pkg (latest) vgo: adding github.com/mewkiz/pkg v0.0.0-20170428133157-c19a6f9fa6f8 vgo: resolving import "github.com/mikkyang/id3-go/encodedbytes" vgo: finding github.com/mikkyang/id3-go (latest) vgo: adding github.com/mikkyang/id3-go v0.0.0-20151201011346-0168d962f1d7 vgo: resolving import "azul3d.org/engine/audio" vgo: finding azul3d.org/engine (latest) vgo: adding azul3d.org/engine v0.0.0-20170701203912-eb48fbeb6d97 vgo: downloading azul3d.org/engine v0.0.0-20170701203912-eb48fbeb6d97 vgo: resolving import "github.com/djimenez/iconv-go" vgo: finding github.com/djimenez/iconv-go (latest) vgo: adding github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da vgo: finding github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da vgo: downloading github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da