dummy up an email address for web commits
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 17 Jul 2008 23:12:34 +0000 (19:12 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 17 Jul 2008 23:12:34 +0000 (19:12 -0400)
Not doing so breaks cia and other things that try to parse a username out
of the email address.

IkiWiki/Rcs/git.pm
doc/todo/git_attribution/discussion.mdwn

index 26f2a39f266b88e477f75545533b2b4d5dfc524a..aa7657b5c201382a02600d078ba7a8dd3cfd96e5 100644 (file)
@@ -319,11 +319,12 @@ sub rcs_commit ($$$;$$) { #{{{
                return $conflict if defined $conflict;
        }
        
-       # Set the commit author to the web committer.
+       # Set the commit author and email to the web committer.
        my %env=%ENV;
        if (defined $user || defined $ipaddr) {
-               $ENV{GIT_AUTHOR_NAME}=(defined $user ? $user : $ipaddr)." (web)";
-               $ENV{GIT_AUTHOR_EMAIL}="";
+               my $u=defined $user ? $user : $ipaddr;
+               $ENV{GIT_AUTHOR_NAME}=$u;
+               $ENV{GIT_AUTHOR_EMAIL}="$u\@web";
        }
 
        # git commit returns non-zero if file has not been really changed.
@@ -390,7 +391,7 @@ sub rcs_recentchanges ($) { #{{{
                }
 
                my $user=$ci->{'author_username'};
-               my $web_commit = ($user=~s/\s+\(web\)$//);
+               my $web_commit = ($user=~s/\@web//);
                
                # compatability code for old web commit messages
                if (! $web_commit &&
index 0078c3ae105a58be3636e2ffd7f152355665cd0e..dfb490bc21e18b4f67b7b4b511ddc82d25bd309c 100644 (file)
@@ -81,3 +81,18 @@ no determination of uniqueness)
 > to be left in. But it will need to take care to only parse that if the
 > commit isn't flagged as a web commit! Else web committers could forge
 > commits from others. --[[Joey]]
+> 
+> BTW, I decided not to use the user's email address in the commit, because
+> then the email becomes part of project history, and you don't really
+> expect that to happen when you give your email address on signup to a web
+> site.
+> 
+> The problem with leaving the email empty is that it confuses some things
+> that try to parse it, including: 
+> * cia (wants a username in there):
+> * git pull --rebase (?)
+> * github pushes to twitter ;-)
+> 
+> So while I tried that way at first, I'm now leaning toward encoding the
+> username in the email address. Like "user <user@web>", or
+> "joey <http://joey.kitenet.net/@web>".