Revert "Build-in "git-shell""
This reverts commit daa0cc9a92c9c2c714aa5f7da6d0ff65b93e0698. It was a stupid idea to do this; when run as a log-in shell, it is spawned with argv[0] set to "-git-shell", so the usual name-based dispatch would not work to begin with.
Junio C Hamano committed
Aug 25, 2008 at 22:39 UTC
1e7abc593d55bc436ccd98f6815d49b13511baa1
4 files changed
+3
-6
Makefile
+1
-1
@@ -546,7 +546,6 @@ BUILTIN_OBJS += builtin-rev-parse.o
546
BUILTIN_OBJS += builtin-revert.o
547
BUILTIN_OBJS += builtin-rm.o
548
BUILTIN_OBJS += builtin-send-pack.o
549
-BUILTIN_OBJS += builtin-shell.o
549
BUILTIN_OBJS += builtin-shortlog.o
550
BUILTIN_OBJS += builtin-show-branch.o
551
BUILTIN_OBJS += builtin-show-ref.o
@@ -822,6 +821,7 @@ EXTLIBS += -lz
821
ifndef NO_POSIX_ONLY_PROGRAMS
822
PROGRAMS += git-daemon$X
823
PROGRAMS += git-imap-send$X
824
+ PROGRAMS += git-shell$X
825
endif
826
ifndef NO_OPENSSL
827
OPENSSL_LIBSSL = -lssl
builtin.h
-1
@@ -88,7 +88,6 @@ extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);
88
extern int cmd_revert(int argc, const char **argv, const char *prefix);
89
extern int cmd_rm(int argc, const char **argv, const char *prefix);
90
extern int cmd_send_pack(int argc, const char **argv, const char *prefix);
91
-extern int cmd_shell(int argc, const char **argv, const char *prefix);
91
extern int cmd_shortlog(int argc, const char **argv, const char *prefix);
92
extern int cmd_show(int argc, const char **argv, const char *prefix);
93
extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
git.c
-1
@@ -338,7 +338,6 @@ static void handle_internal_command(int argc, const char **argv)
338
{ "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
339
{ "rm", cmd_rm, RUN_SETUP },
340
{ "send-pack", cmd_send_pack, RUN_SETUP },
341
- { "shell", cmd_shell },
341
{ "shortlog", cmd_shortlog, USE_PAGER },
342
{ "show-branch", cmd_show_branch, RUN_SETUP },
343
{ "show", cmd_show, RUN_SETUP | USE_PAGER },
shell.c
renamed
+2
-3
@@ -2,7 +2,6 @@
2
#include "quote.h"
3
#include "exec_cmd.h"
4
#include "strbuf.h"
5
-#include "builtin.h"
5
6
static int do_generic_cmd(const char *me, char *arg)
7
{
@@ -45,7 +44,7 @@ static struct commands {
44
{ NULL },
45
};
46
48
-int cmd_shell(int argc, const char **argv, const char *prefix)
47
+int main(int argc, char **argv)
48
{
49
char *prog;
50
struct commands *cmd;
@@ -63,7 +62,7 @@ int cmd_shell(int argc, const char **argv, const char *prefix)
62
else if (argc != 3 || strcmp(argv[1], "-c"))
63
die("What do you think I am? A shell?");
64
66
- prog = xstrdup(argv[2]);
65
+ prog = argv[2];
66
if (!strncmp(prog, "git", 3) && isspace(prog[3]))
67
/* Accept "git foo" as if the caller said "git-foo". */
68
prog[3] = '-';