git: Record the username from openid in the git author email. (This avoids display of ugly google openids.)

master
Joey Hess 2010-06-23 19:44:41 -04:00
parent b38b9327a8
commit a4f381ace8
4 changed files with 23 additions and 7 deletions

View File

@ -506,6 +506,11 @@ sub rcs_commit_staged (@) {
if (defined $u) { if (defined $u) {
$u=encode_utf8($u); $u=encode_utf8($u);
$ENV{GIT_AUTHOR_NAME}=$u; $ENV{GIT_AUTHOR_NAME}=$u;
}
if (defined $params{session}->param("username")) {
$u=encode_utf8($params{session}->param("username"));
}
if (defined $u) {
$ENV{GIT_AUTHOR_EMAIL}="$u\@web"; $ENV{GIT_AUTHOR_EMAIL}="$u\@web";
} }
} }

2
debian/changelog vendored
View File

@ -5,6 +5,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low
parameters. parameters.
* Fixed some confusion and bugginess about whether * Fixed some confusion and bugginess about whether
rcs_getctime/rcs_getmtime were passed absolute or relative filenames. rcs_getctime/rcs_getmtime were passed absolute or relative filenames.
* git: Record the username from openid in the git author email.
(This avoids display of ugly google openids.)
-- Joey Hess <joeyh@debian.org> Wed, 23 Jun 2010 15:30:04 -0400 -- Joey Hess <joeyh@debian.org> Wed, 23 Jun 2010 15:30:04 -0400

View File

@ -10,13 +10,8 @@ generic that it can be adapted to work with many systems by writing a
While all supported revision control systems work well enough for basic While all supported revision control systems work well enough for basic
use, some advanced or special features are not supported in all of them. use, some advanced or special features are not supported in all of them.
Lack of support in [[ikiwiki-makerepo]] or auto.setup can make it harder to The table below summarises this for each revision control system and
set up a wiki using that revision control system. The `rcs_commit_staged` links to more information about each.
hook is needed to use [[attachments|plugins/attachment]] or
[[plugins/comments]]. `rcs_getctime` may be implemented in a fast way
(ie, one log lookup for all files), or very slowly (one lookup per file).
And so on. The table below summarises this for each revision control
system and links to more information about each.
[[!table data=""" [[!table data="""
feature |[[git]]|[[svn]]|[[bzr]] |[[monotone]]|[[mercurial]]|[[darcs]]|[[tla]] |[[cvs]] feature |[[git]]|[[svn]]|[[bzr]] |[[monotone]]|[[mercurial]]|[[darcs]]|[[tla]] |[[cvs]]
@ -30,7 +25,18 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes
`rcs_getmtime` |fast |slow |slow |no |no |no |no |no `rcs_getmtime` |fast |slow |slow |no |no |no |no |no
anonymous push |yes |no |no |no |no |no |no |no anonymous push |yes |no |no |no |no |no |no |no
conflict handling |yes |yes |yes |buggy |yes |yes |yes |yes conflict handling |yes |yes |yes |buggy |yes |yes |yes |yes
openid username |yes |no |no |no |no |no |no |no
"""]] """]]
Notes:
* Lack of support in [[ikiwiki-makerepo]] or auto.setup can make it harder to
set up a wiki using that revision control system.
* The `rcs_commit_staged` hook is needed to use [[attachments|plugins/attachment]]
or [[plugins/comments]].
* `rcs_getctime` and `rcs_getmtime` may be implemented in a fast way (ie, one log
lookup for all files), or very slowly (one lookup per file).
* Openid username support allows avoiding display of Google's ugly openids.
There is a page with [[details]] about how the different systems work with There is a page with [[details]] about how the different systems work with
ikiwiki, for the curious. ikiwiki, for the curious.

View File

@ -38,10 +38,13 @@ A slightly more complex next step would be to request sreg from the provider and
> * Change `rcs_commit` and `rcs_commit_staged` to take a session object, > * Change `rcs_commit` and `rcs_commit_staged` to take a session object,
> instead of just a userid. (For back-compat, if the parameter is > instead of just a userid. (For back-compat, if the parameter is
> not an object, it's a userid.) Bump ikiwiki plugin interface version. > not an object, it's a userid.) Bump ikiwiki plugin interface version.
> (done)
> * Modify all RCS plugins to include the session username somewhere > * Modify all RCS plugins to include the session username somewhere
> in the commit, and parse it back out in `rcs_recentchanges`. > in the commit, and parse it back out in `rcs_recentchanges`.
> (done for git only so far)
> * Modify recentchanges plugin to display the username instead of the > * Modify recentchanges plugin to display the username instead of the
> `openiduser`. > `openiduser`.
> (done)
> * Modify comment plugin to put the session username in the comment > * Modify comment plugin to put the session username in the comment
> template instead of the `openiduser`. > template instead of the `openiduser`.