Skip to content

Instantly share code, notes, and snippets.

View chrmoritz's full-sized avatar

Christian Moritz chrmoritz

  • Berlin, Germany
View GitHub Profile
@chrmoritz
chrmoritz / git-rebase-tags.rb
Last active January 22, 2016 17:24 — forked from njonsson/git-rebase-tags.rb
Using commit messages for commit matching
#! /usr/bin/env ruby
def pluralize(word, count=2, plural_word=nil)
plural_word ||= "#{word}s"
"#{count} #{(count == 1) ? word : plural_word}"
end
unless (ARGV.length == 1) &&
(good_revision = system("git log -1 #{ARGV.first} 2>/dev/null"))
puts "Unknown revision '#{ARGV.first}'" unless good_revision