aboutsummaryrefslogtreecommitdiffstats
path: root/parse-options.h
diff options
context:
space:
mode:
authorLeon Michalak <leonmichalak6@gmail.com>2025-07-29 07:01:51 +0000
committerJunio C Hamano <gitster@pobox.com>2025-07-29 08:52:45 -0700
commit2b3ae04011c3d679ba601c7ef9e20b9dec125ebb (patch)
tree42b7e6f556cf2e469fd80119cdb562cd60128b58 /parse-options.h
parentadd-patch: respect diff.context configuration (diff)
downloadgit-2b3ae04011c3d679ba601c7ef9e20b9dec125ebb.tar.gz
git-2b3ae04011c3d679ba601c7ef9e20b9dec125ebb.zip
add-patch: add diff.context command line overrides
This patch compliments the previous commit, where builtins that use add-patch infrastructure now respect diff.context and diff.interHunkContext file configurations. In particular, this patch helps users who don't want to set persistent context configurations or just want a way to override them on a one-time basis, by allowing the relevant builtins to accept corresponding command line options that override the file configurations. This mimics commands such as diff and log, which allow for both context file configuration and command line overrides. Signed-off-by: Leon Michalak <leonmichalak6@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index 91c3e3c29b..bdae8f1161 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -616,6 +616,8 @@ int parse_opt_tracking_mode(const struct option *, const char *, int);
#define OPT_PATHSPEC_FROM_FILE(v) OPT_FILENAME(0, "pathspec-from-file", v, N_("read pathspec from file"))
#define OPT_PATHSPEC_FILE_NUL(v) OPT_BOOL(0, "pathspec-file-nul", v, N_("with --pathspec-from-file, pathspec elements are separated with NUL character"))
#define OPT_AUTOSTASH(v) OPT_BOOL(0, "autostash", v, N_("automatically stash/stash pop before and after"))
+#define OPT_DIFF_UNIFIED(v) OPT_INTEGER_F('U', "unified", v, N_("generate diffs with <n> lines context"), PARSE_OPT_NONEG)
+#define OPT_DIFF_INTERHUNK_CONTEXT(v) OPT_INTEGER_F(0, "inter-hunk-context", v, N_("show context between diff hunks up to the specified number of lines"), PARSE_OPT_NONEG)
#define OPT_IPVERSION(v) \
OPT_SET_INT_F('4', "ipv4", (v), N_("use IPv4 addresses only"), \