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.
master
Joey Hess 2008-07-17 19:12:34 -04:00
parent 3aa616a526
commit afd3126e55
2 changed files with 20 additions and 4 deletions

View 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 &&

View 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>".