Skip to content

Commit de6d85f

Browse files
committed
userdiff: add diff.<driver>.process config
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>
1 parent f887a7e commit de6d85f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

userdiff.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,13 @@ int userdiff_config(const char *k, const char *v)
499499
drv->algorithm = drv->algorithm_owned;
500500
return ret;
501501
}
502+
if (!strcmp(type, "process")) {
503+
int ret;
504+
FREE_AND_NULL(drv->process_owned);
505+
ret = git_config_string(&drv->process_owned, k, v);
506+
drv->process = drv->process_owned;
507+
return ret;
508+
}
502509

503510
return 0;
504511
}

userdiff.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ struct userdiff_driver {
3131
char *textconv_owned;
3232
struct notes_cache *textconv_cache;
3333
int textconv_want_cache;
34+
const char *process;
35+
char *process_owned;
3436
};
3537
enum userdiff_driver_type {
3638
USERDIFF_DRIVER_TYPE_BUILTIN = 1<<0,

0 commit comments

Comments
 (0)