Created
June 29, 2010 08:08
-
-
Save priithaamer/456958 to your computer and use it in GitHub Desktop.
Capistrano tasks to show git diff and log between local and remote environments
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
namespace :git do | |
desc 'Shows a Git diff between the current version on server and latest on HEAD' | |
task :diff_pending do | |
local_sha = `git rev-parse --verify HEAD` | |
remote_sha = capture("cd #{current_path}; git rev-parse --verify HEAD") | |
puts `git diff #{remote_sha.strip} #{local_sha.strip}` | |
end | |
desc 'Shows a Git log between the current version on server and latest on HEAD' | |
task :log_pending do | |
local_sha = `git rev-parse --verify HEAD` | |
remote_sha = capture("cd #{current_path}; git rev-parse --verify HEAD") | |
puts `git log #{remote_sha.strip}..#{local_sha.strip}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment