[PATCH v2 2/4] userdiff: add diff.<driver>.process config
- From
Michael Montalbo via GitGitGadget <gitgitgadget@gmail.com>
- Date
- May 25, 2026, 18:29 UTC
- Message-ID
- <de6d85f9d756c294b3f450f75c2d62b01a64ec86.1779733799.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2120.v2.git.1779733799.gitgitgadget@gmail.com>
From: Michael Montalbo <mmontalbo@gmail.com>
Add a new per-driver configuration key that specifies the command for a long-running diff process.
The name follows filter.<driver>.process: a long-running subprocess that stays alive across files within a single git invocation.
Signed-off-by: Michael Montalbo <mmontalbo@gmail.com> --- userdiff.c | 7 +++++++ userdiff.h | 2 ++ 2 files changed, 9 insertions(+)
diff --git a/userdiff.c b/userdiff.c index fe710a68bf..81c0bebcce 100644 --- a/userdiff.c +++ b/userdiff.c @@ -499,6 +499,13 @@ int userdiff_config(const char *k, const char *v) drv->algorithm = drv->algorithm_owned; return ret; } + if (!strcmp(type, "process")) { + int ret; + FREE_AND_NULL(drv->process_owned); + ret = git_config_string(&drv->process_owned, k, v); + drv->process = drv->process_owned; + return ret; + } return 0; } diff --git a/userdiff.h b/userdiff.h index 827361b0bc..51c26e0d41 100644 --- a/userdiff.h +++ b/userdiff.h @@ -31,6 +31,8 @@ struct userdiff_driver { char *textconv_owned; struct notes_cache *textconv_cache; int textconv_want_cache; + const char *process; + char *process_owned; }; enum userdiff_driver_type { USERDIFF_DRIVER_TYPE_BUILTIN = 1<<0,
-- gitgitgadget