interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / add-patch.h

74 lines · 1719 bytes Raw Blame History
1#ifndef ADD_PATCH_H
2#define ADD_PATCH_H
3
4#include "color.h"
5
6struct index_state;
7struct pathspec;
8struct repository;
9
10struct interactive_options {
11 int context;
12 int interhunkcontext;
13 int auto_advance;
14};
15
16#define INTERACTIVE_OPTIONS_INIT { \
17 .context = -1, \
18 .interhunkcontext = -1, \
19 .auto_advance = 1, \
20}
21
22struct interactive_config {
23 enum git_colorbool use_color_interactive;
24 enum git_colorbool use_color_diff;
25 char header_color[COLOR_MAXLEN];
26 char help_color[COLOR_MAXLEN];
27 char prompt_color[COLOR_MAXLEN];
28 char error_color[COLOR_MAXLEN];
29 char reset_color_interactive[COLOR_MAXLEN];
30
31 char fraginfo_color[COLOR_MAXLEN];
32 char context_color[COLOR_MAXLEN];
33 char file_old_color[COLOR_MAXLEN];
34 char file_new_color[COLOR_MAXLEN];
35 char reset_color_diff[COLOR_MAXLEN];
36
37 int use_single_key;
38 char *interactive_diff_filter, *interactive_diff_algorithm;
39 int context, interhunkcontext;
40 int auto_advance;
41};
42
43void interactive_config_init(struct interactive_config *cfg,
44 struct repository *r,
45 struct interactive_options *opts);
46void interactive_config_clear(struct interactive_config *cfg);
47
48enum add_p_mode {
49 ADD_P_ADD,
50 ADD_P_STASH,
51 ADD_P_RESET,
52 ADD_P_CHECKOUT,
53 ADD_P_WORKTREE,
54};
55
56enum add_p_flags {
57 /* Disallow "editing" hunks. */
58 ADD_P_DISALLOW_EDIT = (1 << 0),
59};
60
61int run_add_p(struct repository *r, enum add_p_mode mode,
62 struct interactive_options *opts, const char *revision,
63 const struct pathspec *ps,
64 unsigned flags);
65
66int run_add_p_index(struct repository *r,
67 struct index_state *index,
68 const char *index_file,
69 struct interactive_options *opts,
70 const char *revision,
71 const struct pathspec *ps,
72 unsigned flags);
73
74#endif