Skip to content

Cannot pull identities/bugs from raw repository #103

Closed

Description

@gzakhour

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.

Activity

  1. MichaelMure commented on Mar 13, 2019

    @MichaelMure
    Contributor

    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

  2. gzakhour commented on Mar 13, 2019

    @gzakhour
    Author

    I could probably try to fix it this weekend

    It'll be a good excuse to learn some go

  3. MichaelMure commented on Mar 26, 2019

    @MichaelMure
    Contributor

    With a40dcc8, I changed my mind on the architecture design, so this issue has to be fixed with having the cache layer driving both the identity and bug package, instead of the bug package acting as a master for the identity package.

  4. MichaelMure commented on Mar 27, 2019

    @MichaelMure
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugRelates to an issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions