summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/patchtest.README84
1 files changed, 77 insertions, 7 deletions
diff --git a/scripts/patchtest.README b/scripts/patchtest.README
index bfbe29a379..b321d8e47c 100644
--- a/scripts/patchtest.README
+++ b/scripts/patchtest.README
@@ -5,8 +5,7 @@
5Patchtest is a test framework for community patches based on the standard 5Patchtest is a test framework for community patches based on the standard
6unittest python module. As input, it needs three elements to work properly: 6unittest python module. As input, it needs three elements to work properly:
7 7
8- a patch in mbox format (either created with `git format-patch` or fetched 8- one or more patches in separate, mbox-formated files
9from 'patchwork')
10- a test suite 9- a test suite
11- a target repository 10- a target repository
12 11
@@ -94,11 +93,15 @@ cmdline):
94 93
95### Obtaining Patches 94### Obtaining Patches
96 95
97Patch files can be obtained directly from cloned repositories using `git 96Separate, mbox-formatted patch files can be obtained in a number of
98format-patch -N` (where N is the number of patches starting from HEAD to 97ways:
99generate). git-pw can also be used with filters for users, patch/series IDs, 98
100and timeboxes if specific patches are desired. For more information, see the 99 - using b4 to obtain patches from a lore server
101git-pw [documentation](https://patchwork.readthedocs.io/projects/git-pw/en/latest/). 100 - using git-pw to obtain patches from a patchwork server
101 - using "git format-patch ..." to create patches from a git
102 repository
103 - using an email program, such as mutt or thunderbird, to obtain
104 patches from a mailing list
102 105
103Alternatively, `scripts/patchtest-get-series` can be used to pull mbox files from 106Alternatively, `scripts/patchtest-get-series` can be used to pull mbox files from
104the Patchwork instance configured previously in .gitconfig. It uses a log file 107the Patchwork instance configured previously in .gitconfig. It uses a log file
@@ -109,6 +112,73 @@ the target project, but these parameters can be configured using the `--limit`,
109`--interval`, and `--project` arguments respectively. For more information, run 112`--interval`, and `--project` arguments respectively. For more information, run
110`patchtest-get-series -h`. 113`patchtest-get-series -h`.
111 114
115#### git-pw
116
117git-pw can be used with filters for users, patch/series IDs, and
118timeboxes if specific patches are desired. For more information, see the
119git-pw [documentation](https://patchwork.readthedocs.io/projects/git-pw/en/latest/).
120
121For example, to download a single patch from the Yocto Project's
122Patchwork server (and to demonstrate not having modified ~/.gitconfig):
123
124 (patchtest.venv) $ mkdir gawk
125 (patchtest.venv) $ git-pw --server https://patchwork.yoctoproject.org/api/1.2/ --project oe-core patch download --mbox 70101 gawk/
126
127To download a series, for example, try:
128
129 (patchtest.venv) $ mkdir clang
130 (patchtest.venv) $ git-pw --server https://patchwork.yoctoproject.org/api/1.2 --project oe-core series download --separate 38107 clang/
131
132#### git format-patch
133
134Patch files can be obtained directly from a git repository using `git
135format-patch -N` (where N is the number of patches starting from HEAD to
136generate) or using any other way of specifying a range of commit SHAs to
137git.
138
139This method would be the most likely used when testing patches in local
140mode before emailing them for review.
141
142#### b4
143
144In order to use b4, it needs to be installed. Fortunately it is a Python
145program that is hosted on pypi and can easily be installed into the same
146Python virtual environment that was created to run patchwork:
147
148 (patchtest.venv) $ pip install b4
149 (patchtest.venv) $ b4 --version
150 0.14.2
151
152To fetch the same single patch using b4 that was fetched with git-pw
153earlier, use:
154
155 (patchtest.venv) $ mkdir gawk-2
156 (patchtest.venv) $ b4 am -o gawk-2 https://lore.kernel.org/openembedded-core/20250912200740.2873851-1-Randy.MacLeod@windriver.com
157
158Fetching a patch series with b4 is a little more involved since b4 will
159create one mbox file with all the patches in the series in it. Given an
160mbox file with more than one patch in it, patchtest will only test the
161first one. So there needs to be a separate step to break apart the
162multiple patches into separate files:
163
164 (patchtest.venv) $ mkdir clang-2
165 (patchtest.venv) $ b4 am -o ross https://lore.kernel.org/openembedded-core/20250914133258.2625735-1-ross.burton@arm.com
166 (patchtest.venv) $ cat clang-2/v2_20250914_ross_burton_clang_improve_opt_viewer_packageconfig.mbx | formail -ds sh -c 'cat > ross/msg.$FILENO'
167
168NOTE: the formail utility is part of the procmail package for most Linux
169 distributions.
170
171#### mail user agents (MUA)
172
173Most email applications have a way of saving patch emails. Details for
174each MUA is beyond the scope of this document, but it is possible in
175most cases. The only catch is that each patch has to be saved in mbox
176format in its own individual file. Some client applications prefer to
177save emails in the Maildir format, and some programs will save a set of
178patches into one mbox file. The formail program from the procmail
179package is useful for manipulating and converting between formats and
180storage formats.
181
112### Host Mode 182### Host Mode
113 183
114To run patchtest on the host, do the following: 184To run patchtest on the host, do the following: