开发者

Get email address of author in SVN

Is there like a command from which we can get the author's(committer) email in SVN (using h commandline SVN)? or like Can we set up each username to a emai开发者_如何学Gol and get the email from author in hook up scripts?


SVN ( unlike Git ) doesn't care about the email id of the Author. There is just author name, which is usually a username. In most organizations, you must be able to get the email by appending @domain.com to the username.


in file commit-email.pl after my $mail_from = $author; i have added

my @authoremail = &read_from_process('php', '-f', '/usr/bin/svnemail.php', '/var/lib/submin', $author);
$mail_from = shift @authoremail;

content of script /usr/bin/svnemail.php:

<?php
if (isset($argv[1])) {$fpath1=$argv[1];} else die("dummy@dummy.dummy\n");
if (isset($argv[2])) {$usrnm=$argv[2];} else die("dummy@dummy.dummy\n");
$file = fopen($fpath1."/userproperties.conf", "r");
$loginfound=false;
$emailnotfound=true;
while ((!feof($file)) and ($emailnotfound)){
        $line = fgets($file);
    if ($loginfound) {
                if (substr($line,0,1)=="[") {
                        die ("dummy@dummy.dummy\n");
                }
                if (substr($line,0,8)=="email = ") {
                        echo substr($line,8);
                        $emailnotfound=false;
                }
        }
    if (substr($line,0,strlen($argv[2])+2)=="[".$argv[2]."]") {
                $loginfound=true;
        }
}
if ($emailnotfound) {
echo "dummy@dummy.dummy\n";
}
fclose($file);
?>

I am not programmer, so do not punish me fot this code please. Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜