Git-bug: Part 1

Published: Dec 9, 2022 by Isaac Johnson

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

Today we will look at the very latest 0.8.0 release, then for reasons that will become apparent, pivot to the last major release of 0.7.2

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

/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

Trying to solve authentication issues with 0.8.0

While not successful, here are a few of the ways I tried to solve auth issues.

1. Private Repos

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

2. AzDO Repos

Next, I tried an AzDO repo

/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

3. Using then 0.7.2 release then migrating

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

Note: even tho I can _migrate the issues, afterwards I’m still blocked on auth issues_

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

In the end, I filed a bug with git-bug ; #934

4. Trying 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

5. 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

6. Using SSH Auth

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

7. On a Mac with Brew

On a Mac, I’ll try a brew install

WS-C02GD09AMD6V:~ isaac.johnson$ brew install git-bug
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (microsoft/mssql-release, homebrew/core and homebrew/cask).
==> New Formulae
microsoft/mssql-release/msodbcsql17@17.10.2.1
==> New Casks
finch

You have 19 outdated formulae and 1 outdated cask installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Downloading https://ghcr.io/v2/homebrew/core/git-bug/manifests/0.8.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/git-bug/blobs/sha256:c1c29f2a9a1ff994644ab1bb42778c6ec8d7bae2589689ee7efbf5200c626c76
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:c1c29f2a9a1ff994644ab1bb42778c6ec8d7bae2589689ee7efbf5200c626c76?se=2022-11-29T19%3A35%3A0
######################################################################## 100.0%
==> Pouring git-bug--0.8.0.monterey.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/git-bug/0.8.0: 84 files, 32.8MB
==> Running `brew cleanup git-bug`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

WS-C02GD09AMD6V:~ isaac.johnson$ git bug version
git-bug version: v0.8.0

I’ll try a demo repo I created in GH to try

WS-C02GD09AMD6V:Workspaces isaac.johnson$ cd ccr-test/
WS-C02GD09AMD6V:ccr-test isaac.johnson$ git pull
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), 2.07 KiB | 235.00 KiB/s, done.
From https://github.com/idjohnson/ccr-test
 * [new branch]      isaacjohnson-xxxxx-patch-1 -> origin/isaacjohnson-xxxxx-patch-1
   cebcfe8..ec069b0  main                         -> origin/main
Already up to date.

WS-C02GD09AMD6V:ccr-test isaac.johnson$ git bug user create
Building identity cache... Done.
Building bug cache... Done.
Name [Isaac Johnson]: 
Email [isaac.johnson@wellsky.com]: 
Avatar URL: 

Now trying to push shows the same fail

63069e59816de20d51db004ab2c41180218eb7fc6b90bdfe6f7a17f543fde105
WS-C02GD09AMD6V:ccr-test isaac.johnson$ git bug push
Error: authentication required

Pivot: Use stable 0.7.2 Release

I’ll move back in the 0.7.2 release

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ cp /usr/local/bin/072-git-bug /usr/local/bin/git-bug

I’ll resync the AzDO GIT Repo

builder@DESKTOP-72D2D9T:~/Workspaces$ rm -rf ./testgitbug/
builder@DESKTOP-72D2D9T:~/Workspaces$ git clone princessking@vs-ssh.visualstudio.com:v3/princessking/ghost-blog/testgitbug
Cloning into 'testgitbug'...
Warning: Permanently added the RSA host key for IP address '20.37.158.2' to the list of known hosts.
remote: Azure Repos
remote: Found 3 objects to send. (26 ms)
Receiving objects: 100% (3/3), done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd testgitbug/

We’ll create a User

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: http://freshbrewed-test.s3-website-us-east-1.amazonaws.com/content/images/2022/11/isaacjohnson_a_large_golden_crown_over_three_smaller_pincess_je_c5411c3e-f671-4f24-9b9b-9df6ceba161d.png

cac80398ada3be12d864d93d20ec044a7e485dc6

Our first step is to push the User up. We can see we have yet to create an issue

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug push
Warning: Permanently added the RSA host key for IP address '20.37.158.47' to the list of known hosts.
To vs-ssh.visualstudio.com:v3/princessking/ghost-blog/testgitbug
 * [new branch]      refs/identities/cac80398ada3be12d864d93d20ec044a7e485dc6 -> refs/identities/cac80398ada3be12d864d93d20ec044a7e485dc6Everything up-to-date

We can now create an dpush a bug

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug add -t "Bug Title 1" -m "more details about the bug"
7e2af57 created
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
7e2af57 open    Bug Title 1                                             Isaac Johnson      1 💬
Run 'git-bug --help' for usage.
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug push
Warning: Permanently added the RSA host key for IP address '20.37.158.0' to the list of known hosts.
Everything up-to-dateTo vs-ssh.visualstudio.com:v3/princessking/ghost-blog/testgitbug
 * [new branch]      refs/bugs/7e2af5767ec251df1fe886024bb6416a80704fbf -> refs/bugs/7e2af5767ec251df1fe886024bb6416a80704fbf

We wont really see anything in AzDO to reflect this

/content/images/2022/12/gitbug-03.png

We can see the bug info is set inside the repo

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
7e2af57 open    Bug Title 1                                             Isaac Johnson      1 💬
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ cd ..
builder@DESKTOP-72D2D9T:~/Workspaces$ git bug ls
Error: invalid tree, missing the root entry

Now if we clone again (this time we’ll use https), we can see that initially there are no bugs

builder@DESKTOP-72D2D9T:~/Workspaces$ git clone https://princessking.visualstudio.com/ghost-blog/_git/testgitbug testgit
bug2
Cloning into 'testgitbug2'...
remote: Azure Repos
remote: Found 3 objects to send. (29 ms)
Unpacking objects: 100% (3/3), 740 bytes | 21.00 KiB/s, done.
builder@DESKTOP-72D2D9T:~/Workspaces$ cd testgitbug2/
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls
Building identity cache... Done.
Building bug cache... Done.
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls

The flow should be to pull in the bugs

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug pull
Fetching remote ...

Merging data ...
1b5c437: new
cac8039: new
7e2af57: new
d06492e: new
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls
d06492e open    Bug Title 1                                             Isaac Johnson      1 💬
7e2af57 open    Bug Title 1                                             Isaac Johnson      1 💬

We can see that bugs exist outside our branch structure

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git checkout -b somebranch
Switched to a new branch 'somebranch'
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls
d06492e open    Bug Title 1                                             Isaac Johnson      1 💬
7e2af57 open    Bug Title 1                                             Isaac Johnson      1 💬

Before I do anything more, I need to “adopt” a user identity. I have the complication that I’ve pushed my identity up twice.

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug user ls
1b5c437 Isaac Johnson
cac8039 Isaac Johnson
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug user adopt cac8039
Your identity is now: Isaac Johnson

Here we can see git bug termui

But what if you prefer a Web UI.

We can launch that as well

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug webui
Web UI: http://127.0.0.1:44037
Graphql API: http://127.0.0.1:44037/graphql
Graphql Playground: http://127.0.0.1:44037/playground
Press Ctrl+c to quit

We can see our bugs

/content/images/2022/12/gitbug-04.png

We can see details of a bug. This means we can see the markdown I wrote is rendered

/content/images/2022/12/gitbug-05.png

You can see my icon was shown in the UI where appropriate

/content/images/2022/12/gitbug-06.png

I can play with GraphQL as well

/content/images/2022/12/gitbug-07.png

Let’s say I added a comment

/content/images/2022/12/gitbug-08.png

which then shows up

/content/images/2022/12/gitbug-09.png

We can then see it reflected in TermUI

/content/images/2022/12/gitbug-10.png

Before I move on, I want to push up to the repo so I don’t lose progress

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug push
Everything up-to-dateTo https://princessking.visualstudio.com/ghost-blog/_git/testgitbug
   7e2af57..ea3487e  refs/bugs/7e2af5767ec251df1fe886024bb6416a80704fbf -> refs/bugs/7e2af5767ec251df1fe886024bb6416a80704fbf
   d06492e..aa4014b  refs/bugs/d06492e837bc9a2845a652cf1f52b33ccaf1927f -> refs/bugs/d06492e837bc9a2845a652cf1f52b33ccaf1927f

Sprints

Let’s say I want to excerise a basic Agile setup.

Here I’ll assume unlabled are in the ‘backlog’

$ git bug ls
d06492e open    Bug Title 1                                             Isaac Johnson      1 💬
7e2af57 open    Bug Title 1                                             Isaac Johnson      2 💬

Let’s add one to Sprint 1

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug label add 7e2af57 sprint-1
label sprint-1 added
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls
d06492e open    Bug Title 1                                             Isaac Johnson      1 💬
7e2af57 open    Bug Title 1                                      ◼      Isaac Johnson      2 💬

So I can show what is open

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls "status:open sort:edit"
7e2af57 open    Bug Title 1                                      ◼      Isaac Johnson      2 💬
d06492e open    Bug Title 1                                             Isaac Johnson      1 💬

Then I can show those in Sprint-1

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug ls "status:open label:sprint-1 sort:edit"
7e2af57 open    Bug Title 1                                      ◼      Isaac Johnson      2 💬

Types

Let’s say I want to seperate out Features from Bugs. I can use the prefix to indicate this

$ git bug add -t "Feature 1" -m "Some new Idea"
c5f6496 created

So I can search for just bugs that are Features

$ git bug ls --title Feature
c5f6496 open    Feature 1                                               Isaac Johnson      1 💬

And, of course, I could limit by those that are open

$ git bug ls --title Feature --status open
c5f6496 open    Feature 1                                               Isaac Johnson      1 💬

It’s worth noting we can indicate to webui not to open a browser and additionally, specify a given port

builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug2$ git bug webui --port 4000 --no-open
Web UI: http://127.0.0.1:4000
Graphql API: http://127.0.0.1:4000/graphql
Graphql Playground: http://127.0.0.1:4000/playground
Press Ctrl+c to quit

/content/images/2022/12/gitbug-11.png

I can also search in the WebUI allowing me to filter by Sprint

/content/images/2022/12/gitbug-12.png

Or, perhaps, open features

/content/images/2022/12/gitbug-13.png

Summary

We explored a lot. We installed and tried the latest 0.8.0 release many ways but to no avail. I certainly hope to see a working 0.8.1 (or try and fix it myself).

That said, there is lot’s to enjoy with Git-bug. We have a very rich command line tool, a terminal based ui (termui), a nice web frontend (webui) with graphql.

We showed how to create a user and bugs, use labels and add comments and sync between systems using git bug push and git bug pull.

In our next blog post, we’ll dig into the bridge and how that works as well as experiment with containerizing the webui. With bridge we can sync with a few popular issue tracking systems such as github, gitlab, launchpad and JIRA.

gitbug

Have something to add? Feedback? You can use the feedback form

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