Skip to content

Instantly share code, notes, and snippets.

[core]
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes
[hub]
protocol = https
[user]
name = kibitan
email = uzukifirst@gmail.com
[color]
diff = auto
@kibitan
kibitan / commit-msg.rb
Last active August 26, 2016 03:26
.git/hooks/commit-msg: git commit hook for associating to rollbar error
#!/usr/bin/env ruby
current_branch = `git symbolic-ref --short HEAD`
# ブランチ名が iss-{Github Issue ID} の場合
if /^iss-(\d+).*/ =~ current_branch
issue_id = $1
commit_msgs = File.readlines(ARGV[0])
puts 'setup `ghi` command via https://github.com/stephencelis/ghi' unless system('which ghi > /dev/null 2>&1')
%r{https://rollbar.com/.+/items/(\d+)} =~ `ghi show #{issue_id}`
@kibitan
kibitan / commit-msg.rb
Created August 4, 2016 07:33
.git/hooks/commit-msg: git commit hook that auto adding message of associating issue and rollbar error issue
#!/usr/bin/env ruby
current_branch = `git symbolic-ref --short HEAD`
if /^iss-(\d+).*/ =~ current_branch
commit_msgs = File.readlines(ARGV[0])
issue_id = $1
puts 'setup `ghi` command via https://github.com/stephencelis/ghi' unless system('which ghi > /dev/null 2>&1')
%r{https://rollbar.com/.+/items/(\d+)} =~ `ghi show #{issue_id}`
rollbar_item_id = $1