Posted 4 months 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

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Michael Leimstädtner
Last edit:
4 months 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