diff mbox series

[7/8] replace and remove run_command_v_opt_cd_env_tr2()

Message ID f26f7974-3e87-2ddf-6eeb-5d97f80a4e0d@web.de (mailing list archive)
State Superseded
Headers show
Series run-command: remove run_command_v_*() | expand

Commit Message

René Scharfe Oct. 27, 2022, 4:40 p.m. UTC
The convenience function run_command_v_opt_cd_env_tr2() has no external
callers left.  Inline it and remove it from the API.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 run-command.c | 10 ----------
 run-command.h | 10 +---------
 2 files changed, 1 insertion(+), 19 deletions(-)

--
2.38.1

Comments

Ævar Arnfjörð Bjarmason Oct. 27, 2022, 10:46 p.m. UTC | #1
On Thu, Oct 27 2022, René Scharfe wrote:

> diff --git a/run-command.h b/run-command.h
> index 482da7f60c..04bd07dc7a 100644
> --- a/run-command.h
> +++ b/run-command.h
> @@ -233,23 +233,15 @@ int run_auto_maintenance(int quiet);
>  #define RUN_CLOSE_OBJECT_STORE		(1<<7)
>
>  /**
> - * Convenience functions that encapsulate a sequence of
> + * Convenience function that encapsulate a sequence of

Maybe we shouldn't bother, because we remove this altogether in 8/8, but
this has a grammar error, should be:

	Convenience function that encapsulates a sequence of

Or:

	A convenience function that encapsulates a sequence of

Not:

	Convenience function that encapsulate a sequence of

If you're re-rolling I think just dropping this hunk is better.

It can just go away entirely in 8/8. The pre-image had bad grammar
anyway, so not worth fixing just to remove it later.
René Scharfe Oct. 28, 2022, 2:23 p.m. UTC | #2
Am 28.10.22 um 00:46 schrieb Ævar Arnfjörð Bjarmason:
>
> On Thu, Oct 27 2022, René Scharfe wrote:
>
>> diff --git a/run-command.h b/run-command.h
>> index 482da7f60c..04bd07dc7a 100644
>> --- a/run-command.h
>> +++ b/run-command.h
>> @@ -233,23 +233,15 @@ int run_auto_maintenance(int quiet);
>>  #define RUN_CLOSE_OBJECT_STORE		(1<<7)
>>
>>  /**
>> - * Convenience functions that encapsulate a sequence of
>> + * Convenience function that encapsulate a sequence of
>
> Maybe we shouldn't bother, because we remove this altogether in 8/8, but
> this has a grammar error, should be:
>
> 	Convenience function that encapsulates a sequence of
>
> Or:
>
> 	A convenience function that encapsulates a sequence of
>
> Not:
>
> 	Convenience function that encapsulate a sequence of

Ah, good catch.

>
> If you're re-rolling I think just dropping this hunk is better.
>
> It can just go away entirely in 8/8. The pre-image had bad grammar
> anyway, so not worth fixing just to remove it later.
diff mbox series

Patch

diff --git a/run-command.c b/run-command.c
index 32fa4b0ed6..923bad37fe 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1005,12 +1005,6 @@  int run_command(struct child_process *cmd)
 }

 int run_command_v_opt(const char **argv, int opt)
-{
-	return run_command_v_opt_cd_env_tr2(argv, opt, NULL, NULL, NULL);
-}
-
-int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
-				 const char *const *env, const char *tr2_class)
 {
 	struct child_process cmd = CHILD_PROCESS_INIT;
 	strvec_pushv(&cmd.args, argv);
@@ -1022,10 +1016,6 @@  int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
 	cmd.clean_on_exit = opt & RUN_CLEAN_ON_EXIT ? 1 : 0;
 	cmd.wait_after_clean = opt & RUN_WAIT_AFTER_CLEAN ? 1 : 0;
 	cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
-	cmd.dir = dir;
-	if (env)
-		strvec_pushv(&cmd.env, (const char **)env);
-	cmd.trace2_child_class = tr2_class;
 	return run_command(&cmd);
 }

diff --git a/run-command.h b/run-command.h
index 482da7f60c..04bd07dc7a 100644
--- a/run-command.h
+++ b/run-command.h
@@ -233,23 +233,15 @@  int run_auto_maintenance(int quiet);
 #define RUN_CLOSE_OBJECT_STORE		(1<<7)

 /**
- * Convenience functions that encapsulate a sequence of
+ * Convenience function that encapsulate a sequence of
  * start_command() followed by finish_command(). The argument argv
  * specifies the program and its arguments. The argument opt is zero
  * or more of the flags `RUN_COMMAND_NO_STDIN`, `RUN_GIT_CMD`,
  * `RUN_COMMAND_STDOUT_TO_STDERR`, or `RUN_SILENT_EXEC_FAILURE`
  * that correspond to the members .no_stdin, .git_cmd,
  * .stdout_to_stderr, .silent_exec_failure of `struct child_process`.
- * The argument dir corresponds the member .dir. The argument env
- * corresponds to the member .env.
  */
 int run_command_v_opt(const char **argv, int opt);
-/*
- * env (the environment) is to be formatted like environ: "VAR=VALUE".
- * To unset an environment variable use just "VAR".
- */
-int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
-				 const char *const *env, const char *tr2_class);

 /**
  * Execute the given command, sending "in" to its stdin, and capturing its