SlideShare a Scribd company logo
演讲人:Chen Li
<chenli@uniontech.com>
打造操作系统创新生态
Participate in the Linux Community
—— A Guide To The Kernel Development Process and tools
01 powerful git tricks
02 Modern code navigation without
TAGS
04 Send and update your patch
03 Mailing list and mail client
目
录
Basic git concepts
plumbing porcelain object
database
index
working
tree
object type branch tag
head/HEA
D
merge rebase bisect
git worktree --help
What How
Example Why
Worktree is your working directory without index and
object database
- git worktree add
- git worktree remove
- git worktree list
- git worktree move
…
Share the same project-wise git config
Share the same remotes
Easily manage different worktrees
Avoid frequently but annoying git checkout/switch
$ git worktree add -b emergency-fix ../temp
master
$ pushd ../temp
# ... hack hack hack ...
$ git commit -a -m 'emergency fix for boss'
$ popd
$ git worktree remove ../temp
Package your git repo!
Git bundle and archive
Git archive
Git bundle
Move objects and refs by
archive
Hisotry is also included
Create an archive of files
from a named tree
Play well with all git worktrees
and git clone!
History is excluded
git bundle create 4-19-
90.bundle 4-19-90
git archive -o 4-19-90.zip 4-
19-90 -9
Make clean is not required!
Commit meeage or diff
Search something in git log
--grep
-S -G
Git hooks
firstlove@LAPTOP-N1A5G5V0 ~/p/k/linux-sw (6a-inspur-wutip-421)> cat
.git/hooks/post-commit
exec git show --format=email HEAD | ./scripts/checkpatch.pl --strict --codespell
fire off custom scripts when
certain important actions occur.
Why ctags
Modern code navigation without TAGS
efficient Simple
Most kernel
developer use it
Universal
It is really fast even on machine with
performance
Works quite well with vanilla vim!
So, you can easily learn ctags from them
Have many languages support by default
Why not ctags
Modern code navigation without TAGS
Lack on the fly syntax
check
Code completion is
missing or unusable
Know nothing about
how your code will be
compiled
No other modern ide
features!
You cannot know if it can pass compliation until you
really compile it!
It has to index all codes, regardless of .config!
That’s why its ofter Inaccurate even just for code
navigation!
● codelen
● symbol rename
● semantic highlighting
● hierarchies
Cannot take use of other powerful lints!
Kernel is really big, it’s not pritical to remember all
apis.
Code completion is really your friend if you are a
newbiee.
Modern code navigation without TAGS
ccls
c/c++/object-c lsp server, which supports all features mentioned last page
Have nearly all editors support, including vim, emacs, neovim, vscode ...
Mailing list and mail client
1,000 messages
each day
Emails Only (without
anything else!)
Simple but sufficient
Poor man’s forum
LKML
Mailing list and mail client
git-send-email Mutt
mu4e
nmh
Mail client
Mailing list and mail client
smtp imap
refile
archive
Mail client
Send and update your patch
Describe, check and extract your patch (single patch)
./scripts/checkpatch.pl -g HEAD
git format-patch -1 HEAD
Send and update your patch
Describe, check and extract your patch (multiple patches)
# n is your commits number
$ ./scripts/checkpatch.pl -g HEAD-n
$ git format-patch -n HEAD
$ man git-format-patch # for more details
Send and update your patch
Get maintainer and mailing list
$ ./scripts/get_maintainer.pl drivers/gpu/drm/radeon/atom.c
Alex Deucher <alexander.deucher@amd.com>
(supporter:RADEON and AMDGPU DRM DRIVERS)
"Christian König" <christian.koenig@amd.com>
(supporter:RADEON and AMDGPU DRM DRIVERS)
David Airlie <airlied@linux.ie> (maintainer:DRM DRIVERS)
Daniel Vetter <daniel@ffwll.ch> (maintainer:DRM DRIVERS)
amd-gfx@lists.freedesktop.org (open list:RADEON and
AMDGPU DRM DRIVERS)
dri-devel@lists.freedesktop.org (open list:DRM DRIVERS)
linux-kernel@vger.kernel.org (open list)
Send and update your patch
Update your patch
It’s quite common that your first version of patch/patches have
problems you were not aware of. Maintainer(or someone else)
may reply your mail and point out your mistakes.
You can fix/improve your patch/patches then send v2/v3/v4/...:
$ git format-patch … –reroll-count n # n stands for the n times
you send the patch/patches
$ Add changelog in cover-letter
Send and update your patch
Update your patch
Example of changelog inside cover-letter:
Signed-off-by: chenli <chenli at uniontech.com>
---
v1->v2:
* Convert the other assignments of msg as well.
* Casting types to avoid static checker warnings.
---
drivers/gpu/drm/radeon/radeon_uvd.c | 34 ++++++++++++++---------------
1 file changed, 17 insertions(+), 17 deletions(-)
https://www.spinics.net/lists/amd-gfx/msg59986.html
Send and update your patch
Fix other commits
Add: “Fixes:” tag in the commit
message:
Fixes: 3fcb4f01deed ("drm/radeon: Use
kvmalloc for CS chunks")
Signed-off-by: Chen Li
<chenli@xxxxxxxxxxxxx>
---
changelog:
v1->v2: add Fixes: tag
drivers/gpu/drm/radeon/radeon_cs.c | 6 +++--
-
1 file changed, 3 insertions(+), 3 deletions(-)
https://www.spinics.net/lists/amd-
gfx/msg59986.html
If your commits aim to fix bug introduced from other commits, you should:
Any question
Thanks For Listening
感谢聆听

More Related Content

PDF
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
PDF
HTTP/3 in curl 2020
PDF
Docker and .NET Core - Best Friends Forever - Michael Newton - Codemotion Rom...
PDF
Infrastructure as code might be literally impossible
PDF
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
PDF
Infrastructure as code might be literally impossible part 2
PDF
Lightweight development (Lightning talk)
PPT
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
HTTP/3 in curl 2020
Docker and .NET Core - Best Friends Forever - Michael Newton - Codemotion Rom...
Infrastructure as code might be literally impossible
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Infrastructure as code might be literally impossible part 2
Lightweight development (Lightning talk)

What's hot (20)

PDF
Testing curl for security
ODP
Source Code Management systems
PDF
HTTP/3 in curl
PDF
HTTP/3 for everyone
PDF
Landing code in curl
PDF
Fluentd and PHP
PDF
Source Code Management with Git
PDF
DNS over HTTPS
PDF
AppDays Pordenone 2014: Web App Engineering With Dart
PDF
Deconstruct 2017: All programmers MUST learn C and Assembly
PDF
Docker and Fluentd
PDF
Package manages and Puppet - PuppetConf 2015
PDF
curl better
PDF
An introduction to git
PPTX
Php core. get rid of bugs and contribute
PDF
curl roadmap 2020
PDF
kikstart journey of Golang with Hello world - Gopherlabs
PDF
Functional Programming with Streams in node.js
PDF
Http3 fullstackfest-2019
Testing curl for security
Source Code Management systems
HTTP/3 in curl
HTTP/3 for everyone
Landing code in curl
Fluentd and PHP
Source Code Management with Git
DNS over HTTPS
AppDays Pordenone 2014: Web App Engineering With Dart
Deconstruct 2017: All programmers MUST learn C and Assembly
Docker and Fluentd
Package manages and Puppet - PuppetConf 2015
curl better
An introduction to git
Php core. get rid of bugs and contribute
curl roadmap 2020
kikstart journey of Golang with Hello world - Gopherlabs
Functional Programming with Streams in node.js
Http3 fullstackfest-2019
Ad

Similar to Chenli linux-kerne-community (20)

PDF
Gerrit linuxtag2011
PDF
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
PDF
the productive programer: mechanics
PPT
Introduction to Git for developers
PDF
Git_tutorial.pdf
PPT
Life of a Chromium Developer
PPTX
Alexander Kutsan: “C++ compilation boost”
PDF
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
PDF
Getting Git Right
ODP
Amazing KDE (K Desktop Environment)
PDF
Systemd: the modern Linux init system you will learn to love
ODP
Git 101, or, how to sanely manage your Koha customizations
PDF
Systemd for developers
PPTX
Presentation for git jira and linux
ODP
Practical git for developers
PPT
Version Control ThinkVitamin
PPT
DotNet Introduction
PDF
Docker interview Questions-3.pdf
PDF
Makefile
ODP
Some wonderful Linux softwares for daily use
Gerrit linuxtag2011
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
the productive programer: mechanics
Introduction to Git for developers
Git_tutorial.pdf
Life of a Chromium Developer
Alexander Kutsan: “C++ compilation boost”
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
Getting Git Right
Amazing KDE (K Desktop Environment)
Systemd: the modern Linux init system you will learn to love
Git 101, or, how to sanely manage your Koha customizations
Systemd for developers
Presentation for git jira and linux
Practical git for developers
Version Control ThinkVitamin
DotNet Introduction
Docker interview Questions-3.pdf
Makefile
Some wonderful Linux softwares for daily use
Ad

Recently uploaded (20)

PPT
Occupational Health and Safety Management System
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
737-MAX_SRG.pdf student reference guides
PDF
Abrasive, erosive and cavitation wear.pdf
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
Feature types and data preprocessing steps
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Artificial Intelligence
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Occupational Health and Safety Management System
Soil Improvement Techniques Note - Rabbi
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Nature of X-rays, X- Ray Equipment, Fluoroscopy
III.4.1.2_The_Space_Environment.p pdffdf
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
737-MAX_SRG.pdf student reference guides
Abrasive, erosive and cavitation wear.pdf
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
R24 SURVEYING LAB MANUAL for civil enggi
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Feature types and data preprocessing steps
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Artificial Intelligence
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems

Chenli linux-kerne-community

  • 1. 演讲人:Chen Li <chenli@uniontech.com> 打造操作系统创新生态 Participate in the Linux Community —— A Guide To The Kernel Development Process and tools
  • 2. 01 powerful git tricks 02 Modern code navigation without TAGS 04 Send and update your patch 03 Mailing list and mail client 目 录
  • 3. Basic git concepts plumbing porcelain object database index working tree object type branch tag head/HEA D merge rebase bisect
  • 4. git worktree --help What How Example Why Worktree is your working directory without index and object database - git worktree add - git worktree remove - git worktree list - git worktree move … Share the same project-wise git config Share the same remotes Easily manage different worktrees Avoid frequently but annoying git checkout/switch $ git worktree add -b emergency-fix ../temp master $ pushd ../temp # ... hack hack hack ... $ git commit -a -m 'emergency fix for boss' $ popd $ git worktree remove ../temp
  • 5. Package your git repo! Git bundle and archive Git archive Git bundle Move objects and refs by archive Hisotry is also included Create an archive of files from a named tree Play well with all git worktrees and git clone! History is excluded git bundle create 4-19- 90.bundle 4-19-90 git archive -o 4-19-90.zip 4- 19-90 -9 Make clean is not required!
  • 6. Commit meeage or diff Search something in git log --grep -S -G
  • 7. Git hooks firstlove@LAPTOP-N1A5G5V0 ~/p/k/linux-sw (6a-inspur-wutip-421)> cat .git/hooks/post-commit exec git show --format=email HEAD | ./scripts/checkpatch.pl --strict --codespell fire off custom scripts when certain important actions occur.
  • 8. Why ctags Modern code navigation without TAGS efficient Simple Most kernel developer use it Universal It is really fast even on machine with performance Works quite well with vanilla vim! So, you can easily learn ctags from them Have many languages support by default
  • 9. Why not ctags Modern code navigation without TAGS Lack on the fly syntax check Code completion is missing or unusable Know nothing about how your code will be compiled No other modern ide features! You cannot know if it can pass compliation until you really compile it! It has to index all codes, regardless of .config! That’s why its ofter Inaccurate even just for code navigation! ● codelen ● symbol rename ● semantic highlighting ● hierarchies Cannot take use of other powerful lints! Kernel is really big, it’s not pritical to remember all apis. Code completion is really your friend if you are a newbiee.
  • 10. Modern code navigation without TAGS ccls c/c++/object-c lsp server, which supports all features mentioned last page Have nearly all editors support, including vim, emacs, neovim, vscode ...
  • 11. Mailing list and mail client 1,000 messages each day Emails Only (without anything else!) Simple but sufficient Poor man’s forum LKML
  • 12. Mailing list and mail client git-send-email Mutt mu4e nmh Mail client
  • 13. Mailing list and mail client smtp imap refile archive Mail client
  • 14. Send and update your patch Describe, check and extract your patch (single patch) ./scripts/checkpatch.pl -g HEAD git format-patch -1 HEAD
  • 15. Send and update your patch Describe, check and extract your patch (multiple patches) # n is your commits number $ ./scripts/checkpatch.pl -g HEAD-n $ git format-patch -n HEAD $ man git-format-patch # for more details
  • 16. Send and update your patch Get maintainer and mailing list $ ./scripts/get_maintainer.pl drivers/gpu/drm/radeon/atom.c Alex Deucher <alexander.deucher@amd.com> (supporter:RADEON and AMDGPU DRM DRIVERS) "Christian König" <christian.koenig@amd.com> (supporter:RADEON and AMDGPU DRM DRIVERS) David Airlie <airlied@linux.ie> (maintainer:DRM DRIVERS) Daniel Vetter <daniel@ffwll.ch> (maintainer:DRM DRIVERS) amd-gfx@lists.freedesktop.org (open list:RADEON and AMDGPU DRM DRIVERS) dri-devel@lists.freedesktop.org (open list:DRM DRIVERS) linux-kernel@vger.kernel.org (open list)
  • 17. Send and update your patch Update your patch It’s quite common that your first version of patch/patches have problems you were not aware of. Maintainer(or someone else) may reply your mail and point out your mistakes. You can fix/improve your patch/patches then send v2/v3/v4/...: $ git format-patch … –reroll-count n # n stands for the n times you send the patch/patches $ Add changelog in cover-letter
  • 18. Send and update your patch Update your patch Example of changelog inside cover-letter: Signed-off-by: chenli <chenli at uniontech.com> --- v1->v2: * Convert the other assignments of msg as well. * Casting types to avoid static checker warnings. --- drivers/gpu/drm/radeon/radeon_uvd.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) https://www.spinics.net/lists/amd-gfx/msg59986.html
  • 19. Send and update your patch Fix other commits Add: “Fixes:” tag in the commit message: Fixes: 3fcb4f01deed ("drm/radeon: Use kvmalloc for CS chunks") Signed-off-by: Chen Li <chenli@xxxxxxxxxxxxx> --- changelog: v1->v2: add Fixes: tag drivers/gpu/drm/radeon/radeon_cs.c | 6 +++-- - 1 file changed, 3 insertions(+), 3 deletions(-) https://www.spinics.net/lists/amd- gfx/msg59986.html If your commits aim to fix bug introduced from other commits, you should: