-
Notifications
You must be signed in to change notification settings - Fork 362
Translate 08-customizing-git policy #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
(((policy example))) | ||
In this section, you'll use what you've learned to establish a Git workflow that checks for a custom commit message format, and allows only certain users to modify certain subdirectories in a project. | ||
You'll build client scripts that help the developer know if their push will be rejected and server scripts that actually enforce the policies. | ||
在本节中,你将应用前面学到的知识建立这样一个 Git 工作流程:检查提交信息的格式,并且指定特定用户只能修改项目中特定的子目录。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allows only certain users to modify
应该翻译成 指定只能由特定用户修改
,而不是 指定特定用户只能修改
。
谢谢 @gisphm 的review |
@gisphm |
注意一个问题,提交的 Pull Request 右上角显示的增加删除行数应是一致的。 |
更新了下内容,现在中文翻译行数和英文原文行数一致了。 |
Your first challenge is to enforce that each commit message adheres to a particular format. | ||
Just to have a target, assume that each message has to include a string that looks like ``ref: 1234'' because you want each commit to link to a work item in your ticketing system. | ||
You must look at each commit being pushed up, see if that string is in the commit message, and, if the string is absent from any of the commits, exit non-zero so the push is rejected. | ||
你的第一项任务是指定每一条提交信息都必须遵循某种特殊的格式。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
指定=》要求
@spacewander 已完成 |
|
||
You can get a list of the SHA-1 values of all the commits that are being pushed by taking the `$newrev` and `$oldrev` values and passing them to a Git plumbing command called `git rev-list`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我从上面一句句看到这里,我对译主的翻译都没有异议,翻的很棒。这里 “plumbing command” 中的plumbing是底层的意思吗?探讨一下!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
涨知识了!Plumbing管道的意思,其实也是底层 、基础的意思。ok,这个地方就过了!
You'll have the `update` hook look at those rules, see what files are being introduced for all the commits being pushed, and determine whether the user doing the push has access to update all those files. | ||
假设你需要添加一个使用访问权限控制列表的机制,来指定哪些用户对项目的哪些部分有推送权限。 | ||
某些用户具有全部的访问权,其他人只对某些子目录或者特定的文件具有推送权限。 | ||
为了实现这一点,你要把相关的规则写入一个名为 `acl` 的文件里,并把它放到服务器上的 Git 裸仓库中,。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+为了实现这一点,你需要把相关的规则写入位于服务器 Git原始 仓库的acl文件中。这里我把你的两句话合并了,“放到....”直接省略了,个人认为简洁一些。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+为了实现这一点,你要把相关的规则写入位于服务器 原始 Git仓库的acl文件中。
@spacewander #141 我已经完成了审校,有大概13个异议。其实也不是异议,毕竟翻译没有对错,每个人有自己的想法和风格,可以一起探讨一下。我觉得整个章节读下来你译得非常到位,很棒,向你学习! |
@M1sery |
@spacewander @networm OK我全看完了!没有其他问题就并到主干吧! |
@spacewander @gisphm @IceNature @M1sery 已合并入主干。 |
Add missing hyphen
No description provided.