Home

Awesome

Build Status

git-issue

This is a minimalist decentralized issue management system based on Git, offering (optional) biderectional integration with GitHub and GitLab issue management. It has the following advantages over other systems.

Installation

Administrator installation

Clone the repo and run make install with appropriate privileges.

Personal installation

Clone the repo and register a git alias to the git-issue.sh script:

git config --global alias.issue '!'"${REPO_PATH}/git-issue.sh"

If you are using a bash shell, you can also register the autocompletion by adding the following to your .bashrc.

source ${REPO_PATH}/gi-completion.sh

Backward compatibility with the gi command

For backward compatibility you can also use the original gi command, by copying gi.sh to someplace in your path. In this case you must register the git alias to use the auto completion feature. If you have administrative access you can install it with sudo install gi.sh /usr/local/bin/gi. For your personal use, assuming that the directory ~/bin exists and is in your path, you can install it with install gi.sh ~/bin/gi. You can even put gi in your project's current directory and run it from there.

Portability and testing

The git-issue.sh script has been tested on:

Requirements

git-issue requires the jq and curl utilities. OS X users might also need GNU date, obtained by installing homebrew package coreutils. For running the tests shellcheck is also required.

Use

You use git issue with the following sub-commands.

Start an issue repository

Work with an issue

Show multiple issues

Work with multiple issues

Synchronize with remote repositories

Help and debug

Issues and comments are specified through the SHA hash associated with the parent of the commit that opened them, which is specifically crafted for that element and can be used to derive its date and author.

Internals

All data are stored under .issues, which should be placed under .gitignore, if it will coexist with another Git-based project. The directory contains the following elements.

Contributing

Contributions are welcomed through pull requests. Before working on a new feature please look at open issues, and if no corresponding issue is open, create one to claim priority over the task. Contributions should pass tests and should be accompanied with a corresponding test case and documentation update. Note that to avoid duplicating information, the subcommands, the used files, and usage examples, are automatically inserted into the script and its documentation from the README.md file using the sync-docs.sh command.

Video

The video of a presentation of git issue at FOSDEM 2020 is available for streaming or download.

Example session

You can also view a video of the following session on YouTube.

Initialize issue repository

$ git issue init
Initialized empty Issues repository in /home/dds/src/gi/.issues
$ git issue new -s 'New issue entered from the command line'
Added issue e6a95c9

Create a new issue (opens editor window)

$ git issue new
Added issue 7dfa5b7

List open issues

$ git issue list
7dfa5b7 An issue entered from the editor
e6a95c9 New issue entered from the command line

Add an issue comment (opens editor window)

$ git issue comment e6a95c9
Added comment 8c0d5b3

Add a due date for the issue

$ git issue duedate "next Tuesday" e6a95c9
Added duedate 2019-08-13T00:00:00+03:00

Keep track of time spent on the issue

$ git issue timespent "2hours" e6a95c9
Added timespent 7200

Log additional time spent working on it

$ git issue timespent -a "4 hours" e6a95c9
Added timespent 21600

Add tag to an issue

$ git issue tag e6a9 urgent
Added tag urgent

Add two more tags

$ git issue tag e6a9 gui crash
Added tag gui
Added tag crash

Remove a tag

$ git issue tag -r e6a9 urgent
Removed tag urgent

Assign issue

$ git issue assign e6a9 joe@example.com
Assigned to joe@example.com

Add issue watcher

$ git issue watcher e6a9 jane@example.com
Added watcher jane@example.com

List issues tagged as gui

$ git issue list gui
e6a95c9 New issue entered from the command line

Push issues repository to a server

$ git issue git remote add origin git@github.com:dspinellis/gi-example.git
$ git issue git push -u origin master
Counting objects: 60, done.
Compressing objects: 100% (50/50), done.
Writing objects: 100% (60/60), 5.35 KiB | 0 bytes/s, done.
Total 60 (delta 8), reused 0 (delta 0)
To git@github.com:dspinellis/gi-example.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Clone issues repository from server

$ git issue clone git@github.com:dspinellis/gi-example.git my-issues
Cloning into '.issues'...
remote: Counting objects: 60, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 60 (delta 8), reused 60 (delta 8), pack-reused 0
Receiving objects: 100% (60/60), 5.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (8/8), done.
Checking connectivity... done.
Cloned git@github.com:dspinellis/gi-example.git into my-issues

List open issues

$ git issue list
7dfa5b7 An issue entered from the editor
e6a95c9 New issue entered from the command line

Create new issue

$ git issue new -s 'Issue added on another host'
Added issue abc9adc

Push changes to server

$ git issue push
Counting objects: 7, done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 767 bytes | 0 bytes/s, done.
Total 7 (delta 0), reused 0 (delta 0)
To git@github.com:dspinellis/gi-example.git
   d6be890..740f9a0  master -> master

Show issue added on the other host

$ git issue show 7dfa5b7
issue 7dfa5b7f4591ecaa8323716f229b84ad40f5275b
Author: Diomidis Spinellis <dds@aueb.gr>
Date:   Fri, 29 Jan 2016 01:03:24 +0200
Tags:   open

    An issue entered from the editor

    Here is a longer description.

Show issue and comments

$ git issue show -c e6a95c9
issue e6a95c91b31ded8fc229a41cc4bd7d281ce6e0f1
Author: Diomidis Spinellis <dds@aueb.gr>
Date:   Fri, 29 Jan 2016 01:03:20 +0200
Tags:   open urgent gui crash
Watchers:       jane@example.com
Assigned-to: joe@example.com

    New issue entered from the command line

comment 8c0d5b3d77bf93b937cb11038b129f927d49e34a
Author: Diomidis Spinellis <dds@aueb.gr>
Date:   Fri, 29 Jan 2016 01:03:57 +0200

    First comment regarding the issue.

Pull in remote changes (on the original host)

$ git issue pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 7 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
From github.com:dspinellis/gi-example
   d6be890..740f9a0  master     -> origin/master
Updating d6be890..740f9a0
Fast-forward
 issues/ab/c9adc61025a3cb73b0c67470b65cefc133a8d0/description | 1 +
 issues/ab/c9adc61025a3cb73b0c67470b65cefc133a8d0/tags        | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 issues/ab/c9adc61025a3cb73b0c67470b65cefc133a8d0/description
 create mode 100644 issues/ab/c9adc61025a3cb73b0c67470b65cefc133a8d0/tags

List open issues

$ git issue list
7dfa5b7 An issue entered from the editor
abc9adc Issue added on another host
e6a95c9 New issue entered from the command line

Import issues from GitHub

$ git issue import github dspinellis git-issue-test-issues # Import GitHub issues
Imported/updated issue #3 as 0a27c66
Imported/updated issue #2 as feb2a2c
Imported/updated issue #2 comment 416631296 as f7de92c
Imported/updated issue #2 comment 416631349 as 03acf84
Imported/updated issue #2 comment 417048301 as 0cd48ed
Imported/updated issue #2 comment 417049466 as 325a581
Imported/updated issue #1 as bbe144d
$ git issue list
feb2a2c An open issue on GitHub with a description and comments
0a27c66 An open issue on GitHub with assignees and tags
$ git issue show 0a27c66
issue 0a27c6633f492e42bb2a24e6ae458482a4690a55
Author: dspinellis <dspinellis@users.noreply.github.com>
Date:   Thu, 30 Aug 2018 20:59:59 +0000
GitHub issue: #3 at vyrondrosos/git-issue-test-issues
Tags:   bug
        duplicate
        enhancement
        good first issue
        open
Assigned-to:    dspinellis
        louridas

    An open issue on GitHub with assignees and tags

    Description

Edit History:
* Thu, 30 Aug 2018 20:59:59 +0000 by dspinellis
* <dspinellis@users.noreply.github.com>

Export all issues to GitHub

$ git issue exportall github dspinellis git-issue-test-issues
Creating issue 9179d38...
Couldn't add assignee dspinellis. Skipping...
Couldn't add assignee louridas. Skipping...
Creating issue 3651dd3...
Creating new Milestone ver3...
Creating comment d72c68d0177b500a91ea37548e6594f84457fd5b...
Creating comment 6966d4d718c80cf8635e9276d6f391de70c22f93...
Creating comment 85293a6904d0fbd6238fbb2e1c36fc65af9ffc60...
Creating comment aea83723c0414ff135afcfb5165d64f8a7ad687c...

Make changes

$ git issue edit 9179d38
Opening editor...
Edited issue 9179d38
$ git issue edit -c d72c6
Opening editor...
Edited comment d72c68d

Export modified issues back to GitHub

$ git issue export github dspinellis git-issue-test-issues # Needs a token with the relevant permissions
Issue b83d92872dc16440402516a5f4ce1b8cc6436344 not modified, skipping...
Comment a93764f32179e93493ceb0a7060efce1e980aff1 not modified, skipping...
Exporting issue 9179d381135273220301f175c03b101b3e9c703d as #15
Issue 3651dd38e4e1d9dbce66649710324235c773fe78 not modified, skipping...
Updating comment d72c68d0177b500a91ea37548e6594f84457fd5b...
Comment 6966d4d718c80cf8635e9276d6f391de70c22f93 not modified, skipping...
Comment 85293a6904d0fbd6238fbb2e1c36fc65af9ffc60 not modified, skipping...
Comment aea83723c0414ff135afcfb5165d64f8a7ad687c not modified, skipping...

Sub-command auto-completion

$ git issue [Tab]
assign   clone    comment  git      init     log      pull     show     watcher
attach   close    edit     help     list     new      push     tag

Issue SHA auto-completion

$ git issue show [Tab]
7dfa5b7 - An issue entered from the editor
e6a95c9 - New issue entered from the command line

Related work

More historical references can be found in this old LWN article on distributed bug tracking.