Documentation/translations/zh_TW/process/7.AdvancedTopics.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_TW/process/7.AdvancedTopics.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_TW/process/7.AdvancedTopics.rst- Extension
.rst- Size
- 8815 bytes
- Lines
- 138
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../disclaimer-zh_TW.rst
:Original: :ref:`Documentation/process/7.AdvancedTopics.rst <development_advancedtopics>`
:Translator:
時奎亮 Alex Shi <alex.shi@linux.alibaba.com>
:校譯:
吳想成 Wu XiangCheng <bobwxc@email.cn>
胡皓文 Hu Haowen <2023002089@link.tyut.edu.cn>
.. _tw_development_advancedtopics:
高級主題
========
現在,希望您能夠掌握開發流程的工作方式。然而,還有更多的東西要學!本節將介紹
一些主題,這些主題對希望成爲Linux內核開發過程常規部分的開發人員有幫助。
使用Git管理補丁
---------------
內核使用分佈式版本控制始於2002年初,當時Linus首次開始使用專有的Bitkeeper應用
程序。雖然BitKeeper存在爭議,但它所體現的軟件版本管理方法卻肯定不是。分佈式
版本控制可以立即加速內核開發項目。現在有好幾種免費的BitKeeper替代品。
但無論好壞,內核項目都已經選擇了Git作爲其工具。
使用Git管理補丁可以使開發人員的生活更加輕鬆,尤其是隨着補丁數量的增長。Git也
有其粗糙的邊角和一定的危險性,它是一個年輕和強大的工具,仍然在其開發人員完善
中。本文檔不會試圖教會讀者如何使用git;這會是個巨長的文檔。相反,這裏的重點
將是Git如何特別適合內核開發過程。想要加快用Git速度的開發人員可以在以下網站上
找到更多信息:
https://git-scm.com/
https://www.kernel.org/pub/software/scm/git/docs/user-manual.html
同時網上也能找到各種各樣的教程。
在嘗試使用它生成補丁供他人使用之前,第一要務是閱讀上述網頁,對Git的工作方式
有一個紮實的瞭解。使用Git的開發人員應能進行拉取主線存儲庫的副本,查詢修訂
歷史,提交對樹的更改,使用分支等操作。瞭解Git用於重寫歷史的工具(如rebase)
也很有用。Git有自己的術語和概念;Git的新用戶應該瞭解引用、遠程分支、索引、
快進合併、推拉、遊離頭等。一開始可能有點嚇人,但這些概念不難通過一點學習來
理解。
使用git生成通過電子郵件提交的補丁是提高速度的一個很好的練習。
當您準備好開始建立Git樹供其他人查看時,無疑需要一個可以從中拉取的服務器。
如果您有一個可以訪問因特網的系統,那麼使用git-daemon設置這樣的服務器相對
簡單。同時,免費的公共託管網站(例如github)也開始出現在網絡上。成熟的開發
人員可以在kernel.org上獲得一個帳戶,但這些帳戶並不容易得到;更多有關信息,
請參閱 https://kernel.org/faq/ 。
正常的Git工作流程涉及到許多分支的使用。每一條開發線都可以分爲單獨的“主題
分支”,並獨立維護。Git的分支很容易使用,沒有理由不使用它們。而且,在任何
情況下,您都不應該在任何您打算讓其他人從中拉取的分支中進行開發。應該小心地
創建公開可用的分支;當開發分支處於完整狀態並已準備好時(而不是之前)才合併
開發分支的補丁。
Git提供了一些強大的工具,可以讓您重寫開發歷史。一個不方便的補丁(比如說,
一個打破二分法的補丁,或者有其他一些明顯的缺陷)可以在適當的位置修復,或者
完全從歷史中消失。一個補丁系列可以被重寫,就好像它是在今天的主線上寫的一樣,
即使你已經花了幾個月的時間在寫它。可以透明地將更改從一個分支轉移到另一個
分支。等等。明智地使用git修改歷史的能力可以幫助創建問題更少的乾淨補丁集。
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.