20
static int opt_verbosity;
21
static char *opt_progress;
22
23
+/* Options passed to git-merge */
24
+static char *opt_diffstat;
25
+static char *opt_log;
26
+static char *opt_squash;
27
+static char *opt_commit;
28
+static char *opt_edit;
29
+static char *opt_ff;
30
+static char *opt_verify_signatures;
31
+static struct argv_array opt_strategies = ARGV_ARRAY_INIT;
32
+static struct argv_array opt_strategy_opts = ARGV_ARRAY_INIT;
33
+static char *opt_gpg_sign;
34
+
35
static struct option pull_options[] = {
36
/* Shared options */
37
OPT__VERBOSITY(&opt_verbosity),
39
N_("force progress reporting"),
40
PARSE_OPT_NOARG),
41
42
+ /* Options passed to git-merge */
43
+ OPT_GROUP(N_("Options related to merging")),
44
+ OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
45
+ N_("do not show a diffstat at the end of the merge"),
46
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG),
47
+ OPT_PASSTHRU(0, "stat", &opt_diffstat, NULL,
48
+ N_("show a diffstat at the end of the merge"),
49
+ PARSE_OPT_NOARG),
50
+ OPT_PASSTHRU(0, "summary", &opt_diffstat, NULL,
51
+ N_("(synonym to --stat)"),
52
+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
53
+ OPT_PASSTHRU(0, "log", &opt_log, N_("n"),
54
+ N_("add (at most <n>) entries from shortlog to merge commit message"),
55
+ PARSE_OPT_OPTARG),
56
+ OPT_PASSTHRU(0, "squash", &opt_squash, NULL,
57
+ N_("create a single commit instead of doing a merge"),
58
+ PARSE_OPT_NOARG),
59
+ OPT_PASSTHRU(0, "commit", &opt_commit, NULL,
60
+ N_("perform a commit if the merge succeeds (default)"),
61
+ PARSE_OPT_NOARG),
62
+ OPT_PASSTHRU(0, "edit", &opt_edit, NULL,
63
+ N_("edit message before committing"),
64
+ PARSE_OPT_NOARG),
65
+ OPT_PASSTHRU(0, "ff", &opt_ff, NULL,
66
+ N_("allow fast-forward"),
67
+ PARSE_OPT_NOARG),
68
+ OPT_PASSTHRU(0, "ff-only", &opt_ff, NULL,
69
+ N_("abort if fast-forward is not possible"),
70
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG),
71
+ OPT_PASSTHRU(0, "verify-signatures", &opt_verify_signatures, NULL,
72
+ N_("verify that the named commit has a valid GPG signature"),
73
+ PARSE_OPT_NOARG),
74
+ OPT_PASSTHRU_ARGV('s', "strategy", &opt_strategies, N_("strategy"),
75
+ N_("merge strategy to use"),
76
+ 0),
77
+ OPT_PASSTHRU_ARGV('X', "strategy-option", &opt_strategy_opts,
78
+ N_("option=value"),
79
+ N_("option for selected merge strategy"),
80
+ 0),
81
+ OPT_PASSTHRU('S', "gpg-sign", &opt_gpg_sign, N_("key-id"),
82
+ N_("GPG sign commit"),
83
+ PARSE_OPT_OPTARG),
84
+
85
OPT_END()
86
};
87
156
if (opt_progress)
157
argv_array_push(&args, opt_progress);
158
159
+ /* Options passed to git-merge */
160
+ if (opt_diffstat)
161
+ argv_array_push(&args, opt_diffstat);
162
+ if (opt_log)
163
+ argv_array_push(&args, opt_log);
164
+ if (opt_squash)
165
+ argv_array_push(&args, opt_squash);
166
+ if (opt_commit)
167
+ argv_array_push(&args, opt_commit);
168
+ if (opt_edit)
169
+ argv_array_push(&args, opt_edit);
170
+ if (opt_ff)
171
+ argv_array_push(&args, opt_ff);
172
+ if (opt_verify_signatures)
173
+ argv_array_push(&args, opt_verify_signatures);
174
+ argv_array_pushv(&args, opt_strategies.argv);
175
+ argv_array_pushv(&args, opt_strategy_opts.argv);
176
+ if (opt_gpg_sign)
177
+ argv_array_push(&args, opt_gpg_sign);
178
+
179
argv_array_push(&args, "FETCH_HEAD");
180
ret = run_command_v_opt(args.argv, RUN_GIT_CMD);
181
argv_array_clear(&args);