Created
February 15, 2012 17:39
-
-
Save radamant/1837541 to your computer and use it in GitHub Desktop.
A feature branch git-grep script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'set' | |
@term = ARGV[0] | |
def set_from_command(command) | |
result = `#{command}` | |
Set.new(result.split "\n") | |
end | |
current_hits = set_from_command "git grep #{@term}" | |
master_hits = set_from_command "git grep #{@term} master | sed s/^master://" | |
puts "matches for '#{@term}' not in master:" | |
puts '-' * 80 | |
puts (current_hits - master_hits).to_a | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sputnik:robut-rdio(omit-empty-tracks) $ ~/current_branch_grep stream | |
matches for 'stream' not in master: | |
-------------------------------------------------------------------------------- | |
lib/actions/find_action.rb: # We also want to exclude the tracks that cannot be streamed from the resultset | |
lib/actions/find_action.rb: result.can_stream ? result : nil | |
sputnik:robut-rdio(omit-empty-tracks) $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment