Posted about 1 month ago. Visible to the public.

Bash script to list commits by Pivotal Tracker ID

The main benefit of our convention to prefix commits by their corresponding Pivotal Tracker ID is that we can easily detect commits that belong to the same story. You can either do that manually or use the bash script below by copying it somewhere to your .bashrc.

Copy
# Usage: ptcommits '#123456' function ptcommits { if test "$1" then git log --oneline | grep "$1" | grep "^[a-z0-9]*" -o | xargs --no-run-if-empty git show else echo "Please specify a Pivotal Tracker story ID" fi } alias ptcommit='ptcommits'

Caveats

  • ptcommits #<STORY_ID> does not work, since your shell with ignore STORY_ID (it is marked as a comment). Use ptcommits '#<STORY_ID>' instead.

See also

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Michael Leimstädtner
Last edit:
about 1 month ago
by Michael Leimstädtner
Keywords:
bookmarklet
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Michael Leimstädtner to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more