Created
October 11, 2013 08:48
-
-
Save dtan4/6931659 to your computer and use it in GitHub Desktop.
Scan repositories and alert if unpushed commits exist
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 | |
root = Dir.pwd | |
Dir.glob("*").map { |d| File.expand_path(d, root) }.each do |dir| | |
next unless File.ftype(dir) == "directory" | |
Dir.chdir(dir) | |
unpushed = `git rev-list origin/master..master 2>/dev/null | wc -l | tr -d ' '`.to_i | |
puts "#{dir} [#{unpushed}]" if unpushed > 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment