Can see pushed comments but not pushed bugs

Timeline

Jérôme Jutteau (jerome-jutteau) opened (edited)

Hi!

I am discovering git-bug and I got a strange behavior. When performing a git bug push I can see new comments but not new bugs.

Here is my script to reproduce the behavior:

#!/bin/bash
set -e

git init a
cd a
touch readme && git add readme && git commit -am "first commit"
git bug user create
git bug add -t "bug from a" -m "desc"
git bug comment add $(git bug ls-id) -m "comment from a"
cd ..

git clone a b
cd b
git bug user create
git bug pull origin
git bug add -t "bug from b" -m "desc"
for id in $(git bug ls-id); do
    git bug comment add $id  -m "comment from b"
done
git bug push origin
cd ..

cd a
echo "\n\n ------------ we should have two bugs here: -------------" # But only see "bug from a"
git bug ls
for id in $(git bug ls-id); do
    echo "\n\n ------------ we should see comments from b: -------------" # Can see "comment from b"
    git bug show $id
done

Note that I have two files in a/.git/refs/bugs

Anything I missed?

Michael Muré (MichaelMure) commented

This is because git-bug has a cache/index. When you are pushing to a, this cache is not updated because git-bug is not running. It's a simple git push of all the bug/identities data, stored in git branches.

This is usually fine as the remote is usually a server where no one will try to read the bugs but it can come as a problem as you have seen. A solution would likely a git hook to update the cache when refs are pushed.

Closing as this is the same thing as https://github.com/MichaelMure/git-bug/issues/409

Michael Muré (MichaelMure) closed the bug