buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbo...@apache.org
Subject svn commit: r648744 - /incubator/buildr/trunk/doc/scripts/buildr-git.rb
Date Wed, 16 Apr 2008 16:41:24 GMT
Author: vborja
Date: Wed Apr 16 09:41:19 2008
New Revision: 648744

URL: http://svn.apache.org/viewvc?rev=648744&view=rev
Log:
If user supplies --auth or --anon options and is already running on a buildr-git clone,
the remote.origin.url is updated. This way when an anonymous user becomes a
committer he just needs to run buildr-git.rb --auth

Modified:
    incubator/buildr/trunk/doc/scripts/buildr-git.rb

Modified: incubator/buildr/trunk/doc/scripts/buildr-git.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/scripts/buildr-git.rb?rev=648744&r1=648743&r2=648744&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/scripts/buildr-git.rb (original)
+++ incubator/buildr/trunk/doc/scripts/buildr-git.rb Wed Apr 16 09:41:19 2008
@@ -332,9 +332,19 @@
     
     # Start the pager
     run_pager
+    puts
+
+
+    old_origin = `git config --get remote.origin.url`.chomp
+    if member && old_origin !~ /@/
+      puts "Switching to authenticated origin #{origin}", ""
+      `git config remote.origin.url "#{origin}"`
+    elsif !member && old_origin =~ /@/
+      puts "Switching to anonymous origin #{origin}", ""
+      `git config remote.origin.url "#{origin}"`
+    end
     
     # Configure user name and email for git sake (and github's gravatar)
-    puts
     puts "You claim to be #{user_name.inspect} <#{user_email}> "
     puts "with apache-svn user: #{svn_user}" if svn_user
     puts



Mime
View raw message