Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3.  
  4. # get branch name
  5. branch_name = `git branch | grep '*' | sed 's/* //'`
  6. # get ticket id from branch name
  7. ticket_id = ''
  8. if branch_name.include?('-')
  9. # get ticket_id and append '[]'
  10. # like this
  11. # [ID_123] add a file
  12. ticket_id = "[" + [branch_name.split('-')[0], branch_name.split('-')[1]].join('-')+ "]"
  13. end
  14. # append in commit msg
  15. # wrong!
  16. ticket_id + ARGV[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement