Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (19 sloc) 0.609 kb
#!/bin/bash
function _ptid_git_complete_()
{
local line="${COMP_LINE}" # the entire line that is being completed
# check that the commit option was passed to git
if [[ "$line" == "git commit " ]]; then
# get the PivotalTracker Id from the branch name
ptid=`git branch | grep -e "^\*" | sed 's/^\* //g' | sed 's/\-/ /g' | awk '{ print $(NF) }'`
nodigits=$(echo $ptid | sed 's/[[:digit:]]//g')
if [ ! -z $nodigits ]; then
: # do nothing
else
COMPREPLY=("commit -m \"[#$ptid]")
fi
else
__git_main
fi
}
complete -F _ptid_git_complete_ git
Jump to Line
Something went wrong with that request. Please try again.