# [PATCH] run-command.c: remove run_command_v_opt_cd()

3 messages from 2008-10-02 to 2008-10-02. Participants: Nanako Shiraishi, Johannes Sixt, Johannes Schindelin.
Thread: https://gitlist.dev/t/15748

## Nanako Shiraishi, 2008-10-02 10:14

Subject: [PATCH] run-command.c: remove run_command_v_opt_cd()
Message-ID: <20081002191425.6117@nanako3.lavabit.com>
URL: https://gitlist.dev/e/20081002191425.6117%40nanako3.lavabit.com

```
This function is not used anywhere.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
 run-command.c |    8 --------
 run-command.h |    1 -
 2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/run-command.c b/run-command.c
index caab374..c90cdc5 100644
--- a/run-command.c
+++ b/run-command.c
@@ -273,14 +273,6 @@ int run_command_v_opt(const char **argv, int opt)
 	return run_command(&cmd);
 }
 
-int run_command_v_opt_cd(const char **argv, int opt, const char *dir)
-{
-	struct child_process cmd;
-	prepare_run_command_v_opt(&cmd, argv, opt);
-	cmd.dir = dir;
-	return run_command(&cmd);
-}
-
 int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const char *const *env)
 {
 	struct child_process cmd;
diff --git a/run-command.h b/run-command.h
index 4f2b7d7..a8b0c20 100644
--- a/run-command.h
+++ b/run-command.h
@@ -53,7 +53,6 @@ int run_command(struct child_process *);
 #define RUN_GIT_CMD	     2	/*If this is to be git sub-command */
 #define RUN_COMMAND_STDOUT_TO_STDERR 4
 int run_command_v_opt(const char **argv, int opt);
-int run_command_v_opt_cd(const char **argv, int opt, const char *dir);
 
 /*
  * env (the environment) is to be formatted like environ: "VAR=VALUE".
-- 
1.6.0.2

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

```

## Johannes Sixt, 2008-10-02 10:54

Subject: Re: [PATCH] run-command.c: remove run_command_v_opt_cd()
Message-ID: <48E4A878.2090704@viscovery.net>
URL: https://gitlist.dev/e/48E4A878.2090704%40viscovery.net
In-Reply-To: <20081002191425.6117@nanako3.lavabit.com>

```
Nanako Shiraishi schrieb:
> This function is not used anywhere.

Indeed. Future callers can use run_command_v_opt_cd_env() instead.

The function is also mentioned in
Documentation/technical/api-run-command.txt, where you should remove it, too.

-- Hannes

```

## Johannes Schindelin, 2008-10-02 11:09

Subject: Re: [PATCH] run-command.c: remove run_command_v_opt_cd()
Message-ID: <alpine.DEB.1.00.0810021304360.22125@pacific.mpi-cbg.de.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0810021304360.22125%40pacific.mpi-cbg.de.mpi-cbg.de
In-Reply-To: <20081002191425.6117@nanako3.lavabit.com>

```
Hi,

On Thu, 2 Oct 2008, Nanako Shiraishi wrote:

> This function is not used anywhere.

I have to say that it fills me with sorrow, seeing that the direction 
these patches take is the _opposite_ of libifying Git.  So far I was only 
disappointed that nobody pushed this goal, but now I am concerned that 
anybody thinking about it is actively discouraged.

Just think about Git Cheetah: if it were ever to benefit from an official 
libgit, then the function you remove would be _ideal_.  By removing that 
function, you make it even less attractive to try to use Git as a proper 
library.

Ciao,
Dscho

```
