diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-17 19:12:34 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-17 19:12:34 -0400 |
commit | afd3126e555b01ea9e3b5d9f3b7625b2fdca1d12 (patch) | |
tree | a7adf057755a0cc59a0ae2b0f9b5cd269ee9775f | |
parent | 3aa616a5269488f9cfebf7f5d36e0e7f50e08de2 (diff) |
dummy up an email address for web commits
Not doing so breaks cia and other things that try to parse a username out
of the email address.
-rw-r--r-- | IkiWiki/Rcs/git.pm | 9 | ||||
-rw-r--r-- | doc/todo/git_attribution/discussion.mdwn | 15 |
2 files changed, 20 insertions, 4 deletions
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm index 26f2a39f2..aa7657b5c 100644 --- a/IkiWiki/Rcs/git.pm +++ b/IkiWiki/Rcs/git.pm @@ -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 && diff --git a/doc/todo/git_attribution/discussion.mdwn b/doc/todo/git_attribution/discussion.mdwn index 0078c3ae1..dfb490bc2 100644 --- a/doc/todo/git_attribution/discussion.mdwn +++ b/doc/todo/git_attribution/discussion.mdwn @@ -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>". |