diff --git a/book/B-embedding-git/sections/dulwich.asc b/book/B-embedding-git/sections/dulwich.asc index 9a238699..ca0754dd 100644 --- a/book/B-embedding-git/sections/dulwich.asc +++ b/book/B-embedding-git/sections/dulwich.asc @@ -1,14 +1,14 @@ === Dulwich (((Dulwich)))(((Python))) -There is also a pure-Python Git implementation - Dulwich. -The project is hosted under https://www.dulwich.io/ -It aims to provide an interface to git repositories (both local and remote) that doesn't call out to git directly but instead uses pure Python. -It has an optional C extensions though, that significantly improve the performance. +这还有一个纯-Python 的 Git 实现——Dulwich。 +该项目托管在 https://www.dulwich.io/[]。 +它旨在在提供一个与 Git 存储库(本地和远程)的接口,该接口不直接调用 git,而是使用纯 Python。 +它有一个可选的 C 扩展,可以显著提高性能。 -Dulwich follows git design and separate two basic levels of API: plumbing and porcelain. +Dulwich 遵循 git 设计,将 API 分为两个基本级别:底层命令和上层命令。 -Here is an example of using the lower level API to access the commit message of the last commit: +下面是一个使用低级 API 获取上次提交的提交消息的例子: [source, python] ---- @@ -25,7 +25,7 @@ c.message # 'Add note about encoding.\n' ---- -To print a commit log using high-level porcelain API, one can use: +要使用高级上层命令 API 打印提交日志,可以使用: [source, python] ---- @@ -38,6 +38,6 @@ porcelain.log('.', max_entries=1) ---- -==== Further Reading +==== 拓展阅读 -The API documentation, tutorial, and many examples of how to do specific tasks with Dulwich are available on the official website https://www.dulwich.io[]. +在官方网站 https://www.dulwich.io[] 上可以找到 API 文档、教程和许多关于如何使用 Dulwich 完成特定任务的示例。