Git-bug

Published: Dec 13, 2022 by Isaac Johnson

Git-Bug is an OSS project started and sheparded by Michael Mure.

This is a work in progress post as I cannot get the latest 0.8.0 to work.

installation

We can use brew for MacOS

brew install git-bug

As I’m on Linux via WSL, I’ll download an amd64 prebuilt binary from the releases page. At this time, that would be 0.8.0

I’ll download and move it to /usr/local/bin

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ cp /mnt/c/Users/isaac/Downloads/git-bug_linux_amd64 /usr/local/bin/git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git-bug
git-bug is a bug tracker embedded in git.

git-bug use git objects to store the bug tracking separated from the files
history. As bugs are regular git objects, they can be pushed and pulled from/to
the same git remote you are already using to collaborate with other people.

Usage:
  git-bug [flags]
  git-bug [command]

Available Commands:
  add         Create a new bug.
  bridge      Configure and use bridges to other bug trackers.
  commands    Display available commands.
  comment     Display or add comments to a bug.
  completion  Generate the autocompletion script for the specified shell
  deselect    Clear the implicitly selected bug.
  help        Help about any command
  label       Display, add or remove labels to/from a bug.
  ls          List bugs.
  pull        Pull bugs update from a git remote.
  push        Push bugs update to a git remote.
  rm          Remove an existing bug.
  select      Select a bug for implicit use in future commands.
  show        Display the details of a bug.
  status      Display or change a bug status.
  termui      Launch the terminal UI.
  title       Display or change a title of a bug.
  user        Display or change the user identity.
  version     Show git-bug version information.
  webui       Launch the web UI.

Flags:
  -h, --help   help for git-bug

Use "git-bug [command] --help" for more information about a command.

Create a User

The first thing we do is create a user

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug user create
Building identity cache... Done.
Building bug cache... Done.
Name [Isaac Johnson]:
Email [isaac.johnson@gmail.com]:
Avatar URL:

b297bf3e9382da5d559678a220030a7b3b72c922b445e669fdad7451831755d6

I can create a bug on the commandline

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug add
e7cc689 created

We can give it a title and description in the invokation

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug add -t "Bug Title 1" -m "more details about the bug"
ca6acd5 created

At this point, we have an issue as I set this up in an unintialized folder

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug push
Error: remote not found

I’ll init a fresh Git repo

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git init
Initialized empty Git repository in /home/builder/Workspaces/gitbug/.git/
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git checkout -b main
Switched to a new branch 'main'
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git commit --allow-empty -m "empty commit"
[main (root-commit) 1525568] empty commit

I’ll create the Repo in GH

\wsl.localhost\Ubuntu\home\builder\Workspaces\jekyll-blog\content\images\2022\12\gitbug-01.png

Then I can set the remote and push

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git remote add origin https://github.com/theprincessking/gitbug.git
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git push -u origin main
Enumerating objects: 2, done.
Counting objects: 100% (2/2), done.
Writing objects: 100% (2/2), 167 bytes | 167.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0)
To https://github.com/theprincessking/gitbug.git
 * [new branch]      main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.

It seems my user was nixed when I init’ed the repo

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug user
Error: No identity is set.
To interact with bugs, an identity first needs to be created using "git bug user create" or adopted with "git bug user adopt"

I’ll create a new user and bug

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug user create
A lock file is present but the corresponding process is not, removing it.
Name [Isaac Johnson]:
Email [isaac.johnson@gmail.com]:
Avatar URL:

6d2b7a1f24930253faed6ff74c40f67d5b34599c69b54f77480f457aa27bc19c
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug add -t "Bug Title 1" -m "more details about the bug"
a103fd9 created

But it continues to fail without much help in the error message

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git bug push origin
Error: authentication required

I checked the repo details

builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = https://github.com/theprincessking/gitbug.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[git-bug]
        identity = 6d2b7a1f24930253faed6ff74c40f67d5b34599c69b54f77480f457aa27bc19c
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug$ git --version
git version 2.25.1

I next tried with a new private repo in my namespace

builder@DESKTOP-72D2D9T:~/Workspaces$ git clone https://github.com/idjohnson/gitbug2.git
Cloning into 'gitbug2'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 583 bytes | 13.00 KiB/s, done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd github2
-bash: cd: github2: No such file or directory
builder@DESKTOP-72D2D9T:~/Workspaces$ cd gitbug2/
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug ls
Building identity cache... Done.
Building bug cache... Done.
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug user create
Name [Isaac Johnson]:
Email [isaac.johnson@gmail.com]:
Avatar URL:

1352889c597e31daa3cb74078f8c11cf646237924b89e648362cf9459b9a35d7
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug add -t "Bug Title 1" -m "more details about the bug"
758b0c1 created
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug ls
758b0c1 open    Bug Title 1                                             Isaac Johnson
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git push
Everything up-to-date
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug push
Error: authentication required
builder@DESKTOP-72D2D9T:~/Workspaces/gitbug2$ git bug push origin
Error: authentication required

Next, I tried an AzDO repo

\wsl.localhost\Ubuntu\home\builder\Workspaces\jekyll-blog\content\images\2022\12\gitbug-02.png

And that failed as well

builder@DESKTOP-72D2D9T:~/Workspaces$ git clone https://princessking.visualstudio.com/ghost-blog/_git/testgitbug
Cloning into 'testgitbug'...
Username for 'https://princessking.visualstudio.com': isaac.johnson
Password for 'https://isaac.johnson@princessking.visualstudio.com':
remote: Azure Repos
remote: Found 3 objects to send. (30 ms)
Unpacking objects: 100% (3/3), 740 bytes | 92.00 KiB/s, done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd testgitbug/
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
Building identity cache... Done.
Building bug cache... Done.
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug user create
Name [Isaac Johnson]:
Email [isaac.johnson@gmail.com]:
Avatar URL:

0331269461c624ddf083d9271b75eb68068314bbb5cafb1abfa86967ec6bab8e
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug add -t "Bug Title 1" -m "more details about the bug"
5861559 created
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug push origin
Error: authentication required

I’ve been using 0.8.0 till now

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git-bug version
git-bug version: v0.8.0

I moved back to the last release (about 9 months old at this point)

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git-bug version
git-bug version: v0.7.2

Now I repeated the flow

builder@DESKTOP-72D2D9T:~/Workspaces$ rm -rf ./testgitbug/
builder@DESKTOP-72D2D9T:~/Workspaces$ git clone https://princessking.visualstudio.com/ghost-blog/_git/testgitbug
Cloning into 'testgitbug'...
remote: Azure Repos
remote: Found 3 objects to send. (32 ms)
Unpacking objects: 100% (3/3), 740 bytes | 74.00 KiB/s, done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd testgitbug/
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug user create
Building identity cache... Done.
Building bug cache... Done.
Name [Isaac Johnson]:
Email [isaac.johnson@gmail.com]:
Avatar URL:

1b5c437d056a128f53d2e3320ac843ac9ee04cc1
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug add -t "Bug Title 1" -m "more details about the bug"
d06492e created
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git push origin
Everything up-to-date
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug push origin
To https://princessking.visualstudio.com/ghost-blog/_git/testgitbug
 * [new branch]      refs/identities/1b5c437d056a128f53d2e3320ac843ac9ee04cc1 -> refs/identities/1b5c437d056a128f53d2e3320ac843ac9ee04cc1To https://princessking.visualstudio.com/ghost-blog/_git/testgitbug
 * [new branch]      refs/bugs/d06492e837bc9a2845a652cf1f52b33ccaf1927f -> refs/bugs/d06492e837bc9a2845a652cf1f52b33ccaf1927f

We can’t just move the binary to get the new features:

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ cp /usr/local/bin/git-bug /usr/local/bin/072-git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ cp /usr/local/bin/080-git-bug /usr/local/bin/git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
Building identity cache... Error: invalid ref: outdated repository format, please use https://github.com/MichaelMure/git-bug-migration to upgrade

But we can download a migrator: https://github.com/MichaelMure/git-bug-migration/releases/tag/v0.3.4

Now I can migrate

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git-bug-migration
DISCLAIMER: This tool exist for your convenience to migrate your data and allow git-bug's authors to break things and make it better. However, this migration tool is quite crude and experimental. DO NOT TRUST IT BLINDLY.

Please make a backup of your .git folder before running it.

When done, run this tool again with the --for-real flag.
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git-bug-migration --for-real
Migration #1
Purpose: Convert legacy identities into a complete data structure in git

d06492e: migrated to b3d0ba7


Migration #2
Purpose: Migrate bridge credentials from the global git config to a keyring



Migration #3
Purpose: Make bug and identities independent from the storage by making the ID generation self-contained. Also, migrate to the new full DAG entity data model.

identity 1b5c437: migrated to 73519a0
bug b3d0ba7: migrated to 025f7c3


Done!

And sadly, right after migrating, I’m jambed up on the authentication error

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
A lock file is present but the corresponding process is not, removing it.
Building identity cache... Done.
Building bug cache... Done.
025f7c3 open    Bug Title 1                                             Isaac Johnson
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug pull
Fetching remote ...
Error: authentication required

https://github.com/MichaelMure/git-bug/issues/934

From Source

I’ll clone the repo

builder@DESKTOP-72D2D9T:~/Workspaces$ git clone https://github.com/MichaelMure/git-bug.git
Cloning into 'git-bug'...
remote: Enumerating objects: 19766, done.
remote: Counting objects: 100% (326/326), done.
remote: Compressing objects: 100% (229/229), done.
remote: Total 19766 (delta 122), reused 237 (delta 89), pack-reused 19440
Receiving objects: 100% (19766/19766), 22.36 MiB | 3.12 MiB/s, done.
Resolving deltas: 100% (12516/12516), done.

The build it

builder@DESKTOP-72D2D9T:~/Workspaces$ cd git-bug/
builder@DESKTOP-72D2D9T:~/Workspaces/git-bug$ make install
go generate
go: downloading github.com/99designs/gqlgen v0.17.20
go: downloading github.com/gorilla/mux v1.8.0
go: downloading github.com/phayes/freeport v0.0.0-20171002181615-b8543db493a5
go: downloading github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e
go: downloading github.com/spf13/cobra v1.6.1
go: downloading github.com/blevesearch/bleve v1.0.14
go: downloading github.com/go-git/go-billy/v5 v5.3.1
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/MichaelMure/go-term-text v0.3.1
go: downloading github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
go: downloading github.com/mattn/go-isatty v0.0.16
go: downloading github.com/stretchr/testify v1.8.1
go: downloading github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7
go: downloading github.com/99designs/keyring v1.2.1
go: downloading github.com/go-git/go-git/v5 v5.4.2
go: downloading golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
go: downloading golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
go: downloading github.com/awesome-gocui/gocui v1.1.0
go: downloading github.com/dustin/go-humanize v1.0.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/vektah/gqlparser/v2 v2.5.1
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/mattn/go-runewidth v0.0.12
go: downloading golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838
go: downloading golang.org/x/text v0.4.0
go: downloading github.com/dvsekhvalnov/jose2go v1.5.0
go: downloading github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2
go: downloading github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c
go: downloading github.com/mtibben/percent v0.2.1
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/emirpasic/gods v1.12.0
go: downloading github.com/gdamore/tcell/v2 v2.4.0
go: downloading github.com/mitchellh/mapstructure v1.4.1
go: downloading github.com/gorilla/websocket v1.5.0
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading github.com/cheekybits/genny v1.0.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/xanzy/go-gitlab v0.74.0
go: downloading github.com/shurcooL/githubv4 v0.0.0-20190601194912-068505affed7
go: downloading golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c
go: downloading github.com/rivo/uniseg v0.1.0
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: downloading github.com/go-git/gcfg v1.5.0
go: downloading github.com/RoaringBitmap/roaring v0.4.23
go: downloading github.com/blevesearch/zap/v11 v11.0.14
go: downloading github.com/blevesearch/zap/v12 v12.0.14
go: downloading github.com/blevesearch/zap/v13 v13.0.6
go: downloading github.com/blevesearch/zap/v14 v14.0.5
go: downloading github.com/blevesearch/zap/v15 v15.0.3
go: downloading github.com/couchbase/vellum v1.0.2
go: downloading go.etcd.io/bbolt v1.3.5
go: downloading github.com/steveyen/gtreap v0.1.0
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/agnivade/levenshtein v1.1.1
go: downloading github.com/gdamore/encoding v1.0.0
go: downloading github.com/lucasb-eyer/go-colorful v1.0.3
go: downloading github.com/google/go-querystring v1.1.0
go: downloading github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f
go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
go: downloading github.com/hashicorp/go-retryablehttp v0.7.1
go: downloading golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9
go: downloading github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351
go: downloading github.com/xanzy/ssh-agent v0.3.0
go: downloading golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48
go: downloading gopkg.in/warnings.v0 v0.1.2
go: downloading github.com/blevesearch/mmap-go v1.0.2
go: downloading github.com/golang/snappy v0.0.1
go: downloading github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2
go: downloading github.com/tinylib/msgp v1.1.0
go: downloading github.com/willf/bitset v1.1.10
go: downloading google.golang.org/protobuf v1.28.1
go: downloading github.com/blevesearch/snowballstem v0.9.0
go: downloading github.com/philhofer/fwd v1.0.0
go: downloading github.com/blevesearch/segment v0.9.0
go: downloading github.com/blevesearch/go-porterstemmer v1.0.3
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/russross/blackfriday/v2 v2.1.0
Generating documentation ...
  - Markdown: ok
  - ManPage: ok
Generating completion files ...
  - ZSH: ok
  - Fish: ok
  - PowerShell: ok
  - Bash: ok
go install -ldflags "-X github.com/MichaelMure/git-bug/commands.GitCommit=c6bb6b9c7ecddb679966b1561e2e909a9ee5e8cd -X github.com/MichaelMure/git-bug/commands.GitLastTag=v0.8.0 -X github.com/MichaelMure/git-bug/commands.GitExactTag=undefined" .

I’ll move into place

builder@DESKTOP-72D2D9T:~/Workspaces/git-bug$ rm /usr/local/bin/git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/git-bug$ export PATH=$PATH:$(go env GOROOT)/bin:$(go env GOPATH)/bin
builder@DESKTOP-72D2D9T:~/Workspaces/git-bug$ chmod u+x /home/builder/go/bin/git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/git-bug$ git bug version
git-bug version: v0.8.0-dev-c6bb6b9c7e

But in trying to use it, I found it didnt have help nor could add bugs

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ cp /home/builder/go/bin/git-bug /usr/local/bin/git-bug
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug add
Error: unknown command "add" for "git-bug"
Run 'git-bug --help' for usage.
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug version
git-bug version: v0.8.0-dev-c6bb6b9c7e
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug pull
Fetching remote ...
Error: authentication required

Windows

Installing it into C:\Windows\System32 and naming it git-bug.exe

Then I tried to create a user

C:\Users\isaac\Documents\gitbug2>git bug user create
Error: no config entry for the given key

While the interactive mode failed, command line non-interactive mode works

git bug user create --email isaac.johnson@gmail.com --name Isaac --non-interactive

b39d97d38d44320cb61616bdcbbea9103bc7100db14afc02feb2e560a1a72af5

But, yet again, we get the same error

C:\Users\isaac\Documents\gitbug2>git bug user create --email isaac.johnson@gmail.com --name Isaac --non-interactive

b39d97d38d44320cb61616bdcbbea9103bc7100db14afc02feb2e560a1a72af5

C:\Users\isaac\Documents\gitbug2>git bug add -t "Bug Title 1" -m "more details about the bug"
a19e0c0 created

C:\Users\isaac\Documents\gitbug2>git push origin
Everything up-to-date

C:\Users\isaac\Documents\gitbug2>git pull origin
Already up to date.

C:\Users\isaac\Documents\gitbug2>git bug push origin
Error: authentication required

I also tried, in WSL, to use SSH checkout

builder@DESKTOP-72D2D9T:~/Workspaces$ git clone princessking@vs-ssh.visualstudio.com:v3/princessking/ghost-blog/testgitb
ug
Cloning into 'testgitbug'...
The authenticity of host 'vs-ssh.visualstudio.com (20.37.158.23)' can't be established.
RSA key fingerprint is SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'vs-ssh.visualstudio.com,20.37.158.23' (RSA) to the list of known hosts.
remote: Azure Repos
remote: Found 3 objects to send. (33 ms)
Receiving objects: 100% (3/3), done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd testgitbug/
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug user create
Building identity cache... Done.
Building bug cache... Done.

And it too failed

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug pull
Fetching remote ...
Error: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ eval `ssh-agent -s`
Agent pid 4740
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug pull
Fetching remote ...
Error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
gitbug

Isaac Johnson

Isaac Johnson

Cloud Solutions Architect

Isaac is a CSA and DevOps engineer who focuses on cloud migrations and devops processes. He also is a dad to three wonderful daughters (hence the references to Princess King sprinkled throughout the blog).

Theme built by C.S. Rhymes