Cannot pull identities/bugs from raw repository

Labels: Easy pick kind/bug

Timeline

George Zakhour (geezee) opened

Bellow is a series of commands that:

  1. create a bare repository
  2. creates a local repository
  3. creates a commit, an identity, and a bug, and pushes them to the bare repository created in step 1.
  4. clones the bare repository
  5. tries to pull the identities/bugs
cd /tmp
mkdir -p git-bug-bug/bare git-bug-bug/repo
cd git-bug-bug/bare && git init --bare
cd ../repo && git init
echo "Hello World" > README
git add .
git commit -m "initial commit"
git remote add origin ../bare
git push origin master
git bug user create
git bug add # fill in some title and description
git bug push
cd ..
git clone bare clonedrepo
cd clonedrepo
git bug pull

At the very last step I get the following output:

Building identity cache... Done.
Building bug cache... Done.
Fetching remote ...


Merging data ...
8e86a36: invalid data: remote bug is not readable: identity doesn't exist

Creating an identity before git bug pull still produces an error.

Here's my go env variables

go version go1.12 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.12 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.12
uname -v: Darwin Kernel Version 16.6.0: Fri Apr 14 16:13:31 PDT 2017; root:xnu-3789.60.24~4/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.12.5
BuildVersion:	16F2073
lldb --version: lldb-370.0.42
  Swift-3.1

And here's my git version

git version 2.20.1

Please let me know if I forgot to provide any more information.

I managed to recreate the issue on multiple machines: a mac, an ubuntu, and an archlinux machines. I did not have time to debug the issue though.

Michael Muré (MichaelMure) commented

It's because I'm yet to add one of the last piece in this identity refactor. Basically what happen is that fetching/merging works in the bug package, works in the identity package, but the cache layer on top of those still only fetch/merge bugs.

Not a huge piece of code to write though, I'll get there eventually. That's still a bug indeed though.

https://github.com/MichaelMure/git-bug/blob/master/cache/repo_cache.go#L591 https://github.com/MichaelMure/git-bug/blob/master/cache/repo_cache.go#L585

Michael Muré (MichaelMure) added label kind/bug

Michael Muré (MichaelMure) added label Easy pick

George Zakhour (geezee) commented

I could probably try to fix it this weekend

It'll be a good excuse to learn some go

Michael Muré (MichaelMure) commented

I'll add more tests to be sure, but this issue should be resolved with 24d6714dd59a5c385c21991caa47e5727de043d0.

Michael Muré (MichaelMure) closed the bug