I made an emacs command which works in conjunction with this script to make a commitment out of the current line or region:
(defun commit-to-line-or-region ()
"Commit to something in the current line or region."
(interactive)
(let (pos1 pos2 bds)
(if (use-region-p)
(setq pos1 (region-beginning) pos2 (region-end))
(progn
(setq bds (bounds-of-thing-at-point 'line))
(setq pos1 (car bds) pos2 (cdr bds))))
(copy-region-as-kill pos1 pos2)
(shell-command "/bin/bash /home/brent/local/mybin/commit &")
))