Created
April 15, 2015 11:49
-
-
Save index0h/210b7c16a015d2c5447c to your computer and use it in GitHub Desktop.
Commit name maker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Current script works with branches by next standars: | |
# dev-{YYYYmmdd}-{surname}-N{ticket number}-{ticket name} | |
# dev-{YYYYmmdd}-{surname}-{ticket number}-{ticket name} | |
# | |
# {YYYYmmdd} - branch creation date | |
# {surname} - authors surname | |
# {ticket number} - number of ticket in your bug tracker | |
# {ticket name} - short ticket description, words could be separated by - or _ | |
# | |
# Result of current script will be something like | |
# {ticket name separated by space} (refs #{ticket number}) | |
git branch | grep '*' | sed 's/[-_]/ /g' | sed 's/^\* [^ ]\+ [^ ]\+ [^ ]\+ //' | sed 's/N\?\([0-9]\+\) \(.\+\)/\2 (refs #\1)/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment