Created
October 27, 2008 12:46
-
-
Save adamlogic/20092 to your computer and use it in GitHub Desktop.
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
# Original Author: Bryan Helmkamp (http://www.brynary.com/2008/9/1/setting-the-git-commit-author-to-pair-programmers-names) | |
namespace :git do | |
desc "Configures the git author to a list of developers when pair programming; USAGE: sake git:pair AUTHORS=Adam,Jon OR leave off AUTHORS to revert" | |
task :pair do | |
unless File.exists?(".git") | |
puts "This doesn't look like a git repository." | |
exit 1 | |
end | |
authors = ENV["AUTHORS"] | |
pair_email = "[email protected]" | |
if authors.blank? | |
`git config --unset user.name` | |
`git config --unset user.email` | |
puts "Unset user.name and user.email" | |
else | |
`git config user.name '#{authors}'` | |
`git config user.email '#{pair_email}'` | |
puts "user.name = #{authors}" | |
puts "user.email = #{pair_email}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment