Skip to content
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

翻译附录B-Dulwich #495

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions book/B-embedding-git/sections/dulwich.asc
Original file line number Diff line number Diff line change
@@ -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]
----
Expand All @@ -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]
----
Expand All @@ -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 完成特定任务的示例。
Loading