// It's about comments, stupid!
Automate JIRA comment creation from Git commits for a Maven project.
This command line tool will generate a formatted comment for JIRA right into your clipboard that you can then paste into a JIRA comment and get a result such as the following:
git clone ;-)
-
install Git and other dependencies
sudo apt-get update sudo apt-get install git xmlstarlet xclip
-
clone the repo on your disk, for example in your home directory
git clone https://github.com/jirac/jirac.git ~/jirac
-
add
jirac
directory to yourPATH
, for example by adding a line to your.bashrc
echo "export PATH=~/jirac:$PATH" >> ~/.bashrc
-
make sure the environement variable
VISUAL
orEDITOR
is set.# test with the following command echo "if this [$VISUAL$EDITOR] is empty, you must set either property VISUAL or EDITOR" # add vim as your editor in your .bashrc with the following command echo "export EDITOR=vim" >> ~/.bashrc
-
you are done
- install Git Bash
- install mktemp and include its
bin
folder inPATH
- install XMLStarlet
- clone this repo ;) and include the clone directory in
PATH
- define environment variable
VISUAL
orEDITOR
(e.g.: "vim") - done
To install and update jirac
, use homebrew
. See the readme of jirac homebrew recipe.
If you plan to export a graphical editor (such as gedit, Sublime Text etc), you should already know you HAVE TO specify specific options ("-w -s" for gedit, "-n -w" for Sublime) in the editor export so that it BLOCKS the calling script.
Obviously regardless of the editor you use, escape spaces in its path before exporting it!
jirac
may be executed from the any directory of a Maven project version controlled with Git. Otherwise an informative message will be displayed.
After selecting one or more commits, either interactively or with command line arguments, jirac
will generate a formatted text for JIRA
with the following information and copy it to your clipboard:
- name of the projet
- current branch
- current version [for each selected commit]
- commit subject
- link the commit in the GIT graphical interface of the project (if any)
- content
jirac
generates a link to the GIT graphical interface of the project (if any).
Such URL is based on the id of the commit which can not be assumed to be definitive unless the commit has been pushed and shared with other.
Therefore, to remain on the safe side, jirac
enforces pushed commit selection.
😨
Create a Github issue if needed with as much as details as you can.