aboutsummaryrefslogtreecommitdiff
path: root/add-patch.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-02 13:13:09 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-03 15:09:36 -0800
commit48f6d9232834be661f0d1dc4f187b324124ccbe0 (patch)
tree5d5c1aea99cdc705a96cce0451194f347a88189c /add-patch.h
parent0c5583a57d618db191afceeff54e8cafbee89f41 (diff)
downloadgit-48f6d9232834be661f0d1dc4f187b324124ccbe0.tar.xz
add-patch: allow disabling editing of hunks
The "add-patch" mode allows the user to edit hunks to apply custom changes. This is incompatible with a new `git history split` command that we're about to introduce in a subsequent commit, so we need a way to disable this mode. Add a new flag to disable editing hunks. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-patch.h')
-rw-r--r--add-patch.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/add-patch.h b/add-patch.h
index cf2a31a40f..fb6d975b68 100644
--- a/add-patch.h
+++ b/add-patch.h
@@ -53,15 +53,22 @@ enum add_p_mode {
ADD_P_WORKTREE,
};
+enum add_p_flags {
+ /* Disallow "editing" hunks. */
+ ADD_P_DISALLOW_EDIT = (1 << 0),
+};
+
int run_add_p(struct repository *r, enum add_p_mode mode,
struct interactive_options *opts, const char *revision,
- const struct pathspec *ps);
+ const struct pathspec *ps,
+ unsigned flags);
int run_add_p_index(struct repository *r,
struct index_state *index,
const char *index_file,
struct interactive_options *opts,
const char *revision,
- const struct pathspec *ps);
+ const struct pathspec *ps,
+ unsigned flags);
#endif