Skip to content

Commit

Permalink
翻译附录B-Dulwich
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherry520 authored and networm committed Aug 12, 2024
1 parent fcffa56 commit 66c8cea
Showing 1 changed file with 9 additions and 9 deletions.
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 完成特定任务的示例。

0 comments on commit 66c8cea

Please sign in to comment.