Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # get branch name
- branch_name = `git branch | grep '*' | sed 's/* //'`
- # get ticket id from branch name
- ticket_id = ''
- if branch_name.include?('-')
- # get ticket_id and append '[]'
- # like this
- # [ID_123] add a file
- ticket_id = "[" + [branch_name.split('-')[0], branch_name.split('-')[1]].join('-')+ "]"
- end
- # append in commit msg
- # wrong!
- ticket_id + ARGV[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement