diff options
author | Naïm Favier <n@monade.li> | 2022-03-22 19:53:22 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-03-25 01:00:36 +0100 |
commit | bf7d13dc4f54561bb2d8b026e25bda70362b789e (patch) | |
tree | 59cefde7d8c6af2c97c36e8a75c5df2bc00dccdf /doc/contributing | |
parent | 488869f602eea53e3fe08c89bdb655811877cde0 (diff) |
fetchpatch: add `relative`
Allows restricting patches to a specific subdirectory, à la `git diff --relative=subdir`. This cannot be done (cleanly) currently because the `includes` logic happens *after* `stripLen` is applied, so we can't match on `subdir/*`. This change adds a `relative` argument that makes this possible by filtering files before doing any processing, and setting `stripLen` and `extraPrefix` accordingly.
Diffstat (limited to 'doc/contributing')
-rw-r--r-- | doc/contributing/coding-conventions.chapter.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/contributing/coding-conventions.chapter.md b/doc/contributing/coding-conventions.chapter.md index cfe8582e514a4..dac6d828ac0b7 100644 --- a/doc/contributing/coding-conventions.chapter.md +++ b/doc/contributing/coding-conventions.chapter.md @@ -540,10 +540,11 @@ If you do need to do create this sort of patch file, one way to do so is with gi If a patch is available online but does not cleanly apply, it can be modified in some fixed ways by using additional optional arguments for `fetchpatch`: +- `relative`: Similar to using `git-diff`'s `--relative` flag, only keep changes inside the specified directory, making paths relative to it. - `stripLen`: Remove the first `stripLen` components of pathnames in the patch. - `extraPrefix`: Prefix pathnames by this string. -- `excludes`: Exclude files matching this pattern. -- `includes`: Include only files matching this pattern. +- `excludes`: Exclude files matching these patterns (applies after the above arguments). +- `includes`: Include only files matching these patterns (applies after the above arguments). - `revert`: Revert the patch. Note that because the checksum is computed after applying these effects, using or modifying these arguments will have no effect unless the `sha256` argument is changed as well. |