Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby -wKU
- # Usage:
- # $ git mark [character] [branch]
- #
- # Marks a branch with an arbitrary character
- #
- # Examples:
- # $ git mark # removes any mark on the current branch
- # $ git mark r # marks the current branch with "r"
- # $ git mark r topic-1 # marks the "topic-1" branch with "r"
- #
- case ARGV.size
- when 0 then mark = nil
- when 1 then mark, branch, _ = ARGV
- else branch, mark, _ = ARGV
- end
- branch ||= `git name-rev HEAD`.chomp.sub('HEAD ', '') # current branch
- if mark
- `git config branch.#{branch}.peer-review #{mark}`
- puts "Marked '#{branch}' with '#{mark}'."
- else
- `git config --unset branch.#{branch}.peer-review`
- puts "Removed mark on '#{branch}'."
- end
Add Comment
Please, Sign In to add comment