对于我公司的一些特定工作流程问题,我需要允许一些用户工作
使用 CVS,而主存储库位于 git 下。
我选择 git-cvsserver 作为此任务的实现。
我设置了 git 存储库,为 gitcvs 启用它并在上设置了 pserver 模拟
西尼特。一切正常,我可以从 cvs 客户端使用这个存储库,
针对我通过 pserver 模拟创建的 passwd 文件进行身份验证。
我的问题是我通过 CVS 所做的提交显示在运行的用户下
xinetd,不在用户下,我根据 passwd 进行身份验证。
即我以用户“foo”的身份提交到 CVS,我通过 pserver 成功进行了身份验证,
但是当我查看此存储库的 git 提交历史记录时,我发现该提交已
由用户“root”创建。
我查看了 git-cvsserver 的源代码 (http://git.kernel.org/?p=git/git.git;a=blob;f=git-cvsserver.perl)并且似乎使用了CVS登录
仅用于身份验证,不用于实际提交。
SQLite 数据库中的记录也包含“root”用户名,而不是“foo”
您知道如何将 CVS 登录传播到 git 用户名吗?
git 邮件列表中的外部引用: http://thread.gmane.org/gmane .comp.version-control.git/169182
For some specific workflow issues at my company, I need to allow some users work
with CVS, while main repository is under git.
I've chosen git-cvsserver as implementation for this task.
I set up git repository, enabled it for gitcvs and setup a pserver simulation on
xinetd. Everything works fine, I can work with this repository from cvs client,
authenticating against passwd file I created through pserver emulation.
My problem is that commits that I make through CVS are shown under user who runs
xinetd, not under user I authenticate against passwd.
i.e. I commit to CVS as user 'foo', I successfully authenticate through pserver,
but when I look at git history of commits for this repo, i see that commit has
been made by user 'root'.
I looked through source of git-cvsserver (http://git.kernel.org/?p=git/git.git;a=blob;f=git-cvsserver.perl) and it seems that CVS login is used
only for authentication, not for actual committing.
Records in SQLite database contain 'root' username too, not 'foo'
Do you have any ideas how I can propagate CVS login to git username?
xref at git mailing list: http://thread.gmane.org/gmane.comp.version-control.git/169182
发布评论
评论(2)
我对此没有具体的经验,但 git-cvsserver 几乎肯定会调用 git-commit 来完成实际工作。您可以通过设置环境变量(例如
GIT_COMMITTER_EMAIL
和GIT_AUTHOR_EMAIL
)(也是..._NAME
和..._DATE
和..._IDENT
)。如果您有可用的身份验证信息,您只需在实际提交之前将其设置在$ENV
中即可。如果 git-cvsserver 没有清理其环境,您实际上可以在调用它之前从包装器中的身份验证信息中设置这些环境(只是以防任何提交)。I have no specific experience with it, but
git-cvsserver
almost certainly invokesgit-commit
to do the actual work. You can getgit-commit
to use anything you want for the author and committer by setting environment variables likeGIT_COMMITTER_EMAIL
andGIT_AUTHOR_EMAIL
(also..._NAME
and..._DATE
and..._IDENT
). If you have the authentication information available you could simply set it in$ENV
before the actual commit. Ifgit-cvsserver
doesn't clean its environment you could actually set those from the authentication information in a wrapper before invoking it (just in case of any commit).在传播登录之前,如 Ben Jackson 的 answer,使用
GIT_COMMITTER_NAME
/EMAIL
环境变量,确保身份验证步骤正确运行。在 Git 2.34(2021 年第 4 季度)之前,“
git cvsserver
“(man) 其身份验证代码中存在一个长期存在的错误,该错误最终已得到纠正(目前尚不清楚,但如果有人认真使用它,则是一个单独的问题)。请参阅 提交 4b81f69、提交 bffcb4d, Carlo Marcelo Arenas Belón (
carenas
).(由 Junio C Hamano --
gitster
-- 合并于 提交 1030dae,2021 年 10 月 3 日)git cvsserver
现在包含在其 手册页:git cvsserver
现在包含在其 手册页:2023年:警告,不再使用
crypt(3)
,Git 2.44(2024年第一季度)对其进行了适配。请参阅 提交 0856f13、提交 5d70afa, 提交7d05974(2023 年 11 月 10 日),作者:Patrick Steinhardt (
pks-t
)< /a>.(由 Junio C Hamano --
gitster
-- 合并于 提交 0946acf,2023 年 12 月 9 日)Before propagating the login, as shown in Ben Jackson's answer, with
GIT_COMMITTER_NAME
/EMAIL
environment variables, make sure the authentication step did run properly.Before Git 2.34 (Q4 2021), "
git cvsserver
"(man) had a long-standing bug in its authentication code, which has finally been corrected (it is unclear and is a separate question if anybody is seriously using it, though).See commit 4b81f69, commit bffcb4d, commit a7775c7 (15 Sep 2021) by Carlo Marcelo Arenas Belón (
carenas
).(Merged by Junio C Hamano --
gitster
-- in commit 1030dae, 03 Oct 2021)git cvsserver
now includes in its man page:git cvsserver
now includes in its man page:2023: Warning,
crypt(3)
is no longer used, and Git 2.44 (Q1 2024) adapts to it.See commit 0856f13, commit 5d70afa, commit 7d05974 (10 Nov 2023) by Patrick Steinhardt (
pks-t
).(Merged by Junio C Hamano --
gitster
-- in commit 0946acf, 09 Dec 2023)