Command Line Ticketing System

As I have said before life at the ter­mi­nal is a joy. I con­stantly strug­gle with keep­ing myself orga­nized. I actu­ally work pretty well keep­ing most things in my head. But one of these days I’m going to fall down and hit my head and for­get every­thing. So try and try again to keep myself orga­nized and doc­u­mented do I. I was recently pointed to TicGit its a tick­et­ing sys­tem that is meant to inte­grate right into your repos­i­tory. Well I’m not a devel­oper but I can see the ben­e­fit for a ter­mi­nal todo list and gen­eral tick­et­ing for myself as well as my lit­tle script repos­i­tory that is actu­ally main­tained in git. Well ok maybe main­tained is a bit strong of a word. Any­way on to the good stuff.
This is how I got ticgit installed and work­ing for mysef.

sudo aptitude install git-core rubygems rake
sudo gem update --system
sudo gem install git
git clone git://github.com/schacon/ticgit.git ticgit.git
cd ticgit.git
rake
sudo gem install pkg/ticgit-0.2.0.gem
cd

Not to bad eh? Well we are not quite done. ticgit needs a git repos­i­tory so if your going to use this for a sim­ple todo list you need to go ahead and get a git repo setup for it.

mkdir ticgit
cd ticgit
git init
echo 'please use ti command to view the todos' | tee  readme.txt
git add readme.txt
git commit -m 'initial commit'

Now you can use ticgit in this direc­troy. You should like the ti com­mand to some­thing in your path.

sudo ln -s  /var/lib/gems/1.8/bin/ti /usr/local/bin/ti

Now you can use the ti com­mands list, show, new, check­out, state,. com­ment, and tag to update your sim­ple tick­et­ing sys­tem.
What? .… Yeah so I remem­ber most thing but remem­ber­ing those options isn’t one of them. Plus I don’t like to type any more that I have to. So I wrote a bash_completion stub for ti. All you have to do is drop it in your /etc/bash_completion.d/ as ti_completion


# Author: Nick Anderson
# http://www.cmdln.org
# Description: Simple Bash Completion for ticgit

_ti()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="list show new checkout state comment tag"

case "${prev}" in
list)
local list_opts="--order --tag --state --assigned --saveas --list"
COMPREPLY=( $(compgen -W "${list_opts}" -- ${cur}) )
return 0
;;
ti)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
state)
local state_opts="open resolved invalid hold"
COMPREPLY=( $(compgen -W "${state_opts}" ${cur}) )
return 0
;;
*)
return 0
;;
esac

}
complete -F _ti ti

I also made up a quick screen­cast of ticgit so you can see it in all of its glory. Watch the TicGit Screen­cast.

5 Comments

  • […] main­tained in git. Well ok maybe main­tained is a bit strong of a word. Any­way on to the good stuff. TicGit howto, com­mand line tick­et­ing sys­tem As I have said before life at the ter­mi­nal is a joy. I con­stantly strug­gle with keep­ing myself […]

  • Roland Ubuntu Firefox 2.0.0.13 wrote:

    Nice tip. My one com­plain is that your ‘recent arti­cles’ slidet­icker causes quite a strain on my cpu.

    (run­ning Fire­fox 2.0.0.13 on Ubuntu 7.10)

  • Jim Vanderveen Mac OS X Firefox 2.0.0.16 wrote:

    Sec­ond­ing Roland’s com­ment. I always get sus­pi­cious when my CPU is pegging.

    FYI, I’m run­ning Fire­fox 2.0.0.16 on Mac OS X 10.5.4 (Power­Book G4, non-Intel chip).

  • Ok 2 com­plaints is enough, I removed the slider. Thanks for reading.

  • Hey how goes.
    I’ve become the main­tainer for ticgit as Scott Cha­con is pre­oc­cu­pied with other more excit­ing things.

    Awe­some bash com­ple­tion snip­pet! That’s the first I’ve heard of bash com­ple­tion for ticgit. Love the screen­cast too, I’m going to link back to here from the Readme, this is the first screen­cast for ticgit that I’ve come across, it could be use­ful to other people.

    Looks like the blog and screen­cast are from 2008, but their still rel­e­vant with today’s ticgit.

    http://github.com/jeffWelling/ticgit

Leave a Reply

Your email is never shared.Required fields are marked *

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha