# Commits.to bash script

**URL:** <https://forum.beeminder.com/t/commits-to-bash-script/5199>\
**Category:** CommitsTo\
**Created:** [April 9, 2019, 10:46am UTC](https://forum.beeminder.com/t/commits-to-bash-script/5199 "2019-04-09T10:46:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![byorgey](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.beeminder.com/byorgey/32/70_2.png) [@byorgey](https://forum.beeminder.com/u/byorgey)\
**Post date:** [May 6, 2019, 10:58am UTC](https://forum.beeminder.com/t/commits-to-bash-script/5199/2 "2019-05-06T10:58:40Z")

</div>

I made an emacs command which works in conjunction with this script to make a commitment out of the current line or region:

```auto
(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 &")
  ))

```

---

_[View the full topic](https://forum.beeminder.com/t/commits-to-bash-script/5199)._
