Created
September 16, 2008 16:26
-
-
Save jamesmacaulay/11053 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# branchmate | |
# opens whichever files you've modified in this git branch compared to master | |
target = ARGV[0] || 'master' | |
p (cmd = "git diff #{target} --name-only") | |
files = `#{cmd}`.split.reject {|f| f =~ /^vendor/} | |
puts files.join("\n") | |
if files.length > 10 | |
puts "\nReally open all #{files.length} files? [y/N]" | |
exit unless $stdin.gets =~ /^[Yy]/ | |
end | |
`mate .` | |
files.each {|file| system("mate #{file}")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment