rebase, sequencer: remove the broken GIT_QUIET handling
The GIT_QUIET environment variable was used to signal the non-am backends that the rebase should perform quietly. The preserve-merges backend does not make use of the quiet flag anywhere (other than to write out its state whenever it writes state), and this mechanism was broken in the conversion from shell to C. Since this environment variable was specifically designed for scripts and the only backend that would still use it is no longer a script, just gut this code. A subsequent commit will fix --quiet for the interactive/merge backend in a different way. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Feb 15, 2020 at 21:36 UTC
8a997ed132f7b8709d1752b64779566600345375
2 files changed
+4
-8
builtin/rebase.c
+2
-4
@@ -699,8 +699,8 @@ static int rebase_write_basic_state(struct rebase_options *opts)
699
opts->onto ? oid_to_hex(&opts->onto->object.oid) : "");
700
write_file(state_dir_path("orig-head", opts), "%s",
701
oid_to_hex(&opts->orig_head));
702
- write_file(state_dir_path("quiet", opts), "%s",
703
- opts->flags & REBASE_NO_QUIET ? "" : "t");
702
+ if (!(opts->flags & REBASE_NO_QUIET))
703
+ write_file(state_dir_path("quiet", opts), "%s", "");
704
if (opts->flags & REBASE_VERBOSE)
705
write_file(state_dir_path("verbose", opts), "%s", "");
706
if (opts->strategy)
@@ -1153,8 +1153,6 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
1153
add_var(&script_snippet, "revisions", opts->revisions);
1154
add_var(&script_snippet, "restrict_revision", opts->restrict_revision ?
1155
oid_to_hex(&opts->restrict_revision->object.oid) : NULL);
1156
- add_var(&script_snippet, "GIT_QUIET",
1157
- opts->flags & REBASE_NO_QUIET ? "" : "t");
1156
sq_quote_argv_pretty(&buf, opts->git_am_opts.argv);
1157
add_var(&script_snippet, "git_am_opt", buf.buf);
1158
strbuf_release(&buf);
sequencer.c
+2
-4
@@ -2570,8 +2570,6 @@ static void write_strategy_opts(struct replay_opts *opts)
2570
int write_basic_state(struct replay_opts *opts, const char *head_name,
2571
struct commit *onto, const char *orig_head)
2572
{
2573
- const char *quiet = getenv("GIT_QUIET");
2574
-
2573
if (head_name)
2574
write_file(rebase_path_head_name(), "%s\n", head_name);
2575
if (onto)
@@ -2580,8 +2578,8 @@ int write_basic_state(struct replay_opts *opts, const char *head_name,
2578
if (orig_head)
2579
write_file(rebase_path_orig_head(), "%s\n", orig_head);
2580
2583
- if (quiet)
2584
- write_file(rebase_path_quiet(), "%s\n", quiet);
2581
+ if (opts->quiet)
2582
+ write_file(rebase_path_quiet(), "%s", "");
2583
if (opts->verbose)
2584
write_file(rebase_path_verbose(), "%s", "");
2585
if (opts->strategy)