{"thread":{"id":"8826","subject":"[PATCH 1/2] Remove obsolete commit-walkers","startedAt":"2007-07-03T05:28:16Z","lastAt":"2007-07-04T16:57:27Z","messageCount":6,"participants":["Daniel Barkalow","Junio C Hamano","Bill Lear","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"46331","messageId":"Pine.LNX.4.64.0707030128110.14638@iabervon.org","threadId":"8826","inReplyTo":null,"subject":"[PATCH 1/2] Remove obsolete commit-walkers","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-07-03T05:28:16Z","receivedAt":"2007-07-03T05:28:16Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Removes the commit-walkers that are no longer useful, as well as\nlibrary code that was only used by ssh-fetch/push.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Makefile      |   20 +----\n local-fetch.c |  254 ---------------------------------------------------------\n rsh.c         |   83 -------------------\n rsh.h         |    7 --\n ssh-fetch.c   |  166 -------------------------------------\n ssh-pull.c    |    4 -\n ssh-push.c    |    4 -\n ssh-upload.c  |  143 --------------------------------\n 8 files changed, 4 insertions(+), 677 deletions(-)\n delete mode 100644 local-fetch.c\n delete mode 100644 rsh.c\n delete mode 100644 rsh.h\n delete mode 100644 ssh-fetch.c\n delete mode 100644 ssh-pull.c\n delete mode 100644 ssh-push.c\n delete mode 100644 ssh-upload.c\n\ndiff --git a/Makefile b/Makefile\nindex 4ea5e45..705dde5 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -239,14 +239,14 @@ endif\n # ... and all the rest that could be moved out of bindir to gitexecdir\n PROGRAMS = \\\n \tgit-convert-objects$X git-fetch-pack$X \\\n-\tgit-hash-object$X git-index-pack$X git-local-fetch$X \\\n+\tgit-hash-object$X git-index-pack$X \\\n \tgit-fast-import$X \\\n \tgit-daemon$X \\\n \tgit-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \\\n \tgit-peek-remote$X git-receive-pack$X \\\n \tgit-send-pack$X git-shell$X \\\n-\tgit-show-index$X git-ssh-fetch$X \\\n-\tgit-ssh-upload$X git-unpack-file$X \\\n+\tgit-show-index$X \\\n+\tgit-unpack-file$X \\\n \tgit-update-server-info$X \\\n \tgit-upload-pack$X \\\n \tgit-pack-redundant$X git-var$X \\\n@@ -274,9 +274,6 @@ ifndef NO_TCLTK\n OTHER_PROGRAMS += gitk-wish\n endif\n \n-# Backward compatibility -- to be removed after 1.0\n-PROGRAMS += git-ssh-pull$X git-ssh-push$X\n-\n # Set paths to tools early so that they can be used for version tests.\n ifndef SHELL_PATH\n \tSHELL_PATH = /bin/sh\n@@ -884,14 +881,6 @@ endif\n git-%$X: %.o $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)\n \n-ssh-pull.o: ssh-fetch.c\n-ssh-push.o: ssh-upload.c\n-git-local-fetch$X: fetch.o\n-git-ssh-fetch$X: rsh.o fetch.o\n-git-ssh-upload$X: rsh.o\n-git-ssh-pull$X: rsh.o fetch.o\n-git-ssh-push$X: rsh.o\n-\n git-imap-send$X: imap-send.o $(LIB_FILE)\n \n http.o http-fetch.o http-push.o: http.h\n@@ -1103,8 +1092,7 @@ check-docs::\n \t\tgit-merge-octopus | git-merge-ours | git-merge-recursive | \\\n \t\tgit-merge-resolve | git-merge-stupid | \\\n \t\tgit-add--interactive | git-fsck-objects | git-init-db | \\\n-\t\tgit-repo-config | git-fetch--tool | \\\n-\t\tgit-ssh-pull | git-ssh-push ) continue ;; \\\n+\t\tgit-repo-config | git-fetch--tool ) continue ;; \\\n \t\tesac ; \\\n \t\ttest -f \"Documentation/$$v.txt\" || \\\n \t\techo \"no doc: $$v\"; \\\ndiff --git a/local-fetch.c b/local-fetch.c\ndeleted file mode 100644\nindex bf7ec6c..0000000\n--- a/local-fetch.c\n+++ /dev/null\n@@ -1,254 +0,0 @@\n-/*\n- * Copyright (C) 2005 Junio C Hamano\n- */\n-#include \"cache.h\"\n-#include \"commit.h\"\n-#include \"fetch.h\"\n-\n-static int use_link;\n-static int use_symlink;\n-static int use_filecopy = 1;\n-static int commits_on_stdin;\n-\n-static const char *path; /* \"Remote\" git repository */\n-\n-void prefetch(unsigned char *sha1)\n-{\n-}\n-\n-static struct packed_git *packs;\n-\n-static void setup_index(unsigned char *sha1)\n-{\n-\tstruct packed_git *new_pack;\n-\tchar filename[PATH_MAX];\n-\tstrcpy(filename, path);\n-\tstrcat(filename, \"/objects/pack/pack-\");\n-\tstrcat(filename, sha1_to_hex(sha1));\n-\tstrcat(filename, \".idx\");\n-\tnew_pack = parse_pack_index_file(sha1, filename);\n-\tnew_pack->next = packs;\n-\tpacks = new_pack;\n-}\n-\n-static int setup_indices(void)\n-{\n-\tDIR *dir;\n-\tstruct dirent *de;\n-\tchar filename[PATH_MAX];\n-\tunsigned char sha1[20];\n-\tsprintf(filename, \"%s/objects/pack/\", path);\n-\tdir = opendir(filename);\n-\tif (!dir)\n-\t\treturn -1;\n-\twhile ((de = readdir(dir)) != NULL) {\n-\t\tint namelen = strlen(de->d_name);\n-\t\tif (namelen != 50 ||\n-\t\t    !has_extension(de->d_name, \".pack\"))\n-\t\t\tcontinue;\n-\t\tget_sha1_hex(de->d_name + 5, sha1);\n-\t\tsetup_index(sha1);\n-\t}\n-\tclosedir(dir);\n-\treturn 0;\n-}\n-\n-static int copy_file(const char *source, char *dest, const char *hex,\n-\t\t     int warn_if_not_exists)\n-{\n-\tsafe_create_leading_directories(dest);\n-\tif (use_link) {\n-\t\tif (!link(source, dest)) {\n-\t\t\tpull_say(\"link %s\\n\", hex);\n-\t\t\treturn 0;\n-\t\t}\n-\t\t/* If we got ENOENT there is no point continuing. */\n-\t\tif (errno == ENOENT) {\n-\t\t\tif (!warn_if_not_exists)\n-\t\t\t\treturn -1;\n-\t\t\treturn error(\"does not exist %s\", source);\n-\t\t}\n-\t}\n-\tif (use_symlink) {\n-\t\tstruct stat st;\n-\t\tif (stat(source, &st)) {\n-\t\t\tif (!warn_if_not_exists && errno == ENOENT)\n-\t\t\t\treturn -1;\n-\t\t\treturn error(\"cannot stat %s: %s\", source,\n-\t\t\t\t     strerror(errno));\n-\t\t}\n-\t\tif (!symlink(source, dest)) {\n-\t\t\tpull_say(\"symlink %s\\n\", hex);\n-\t\t\treturn 0;\n-\t\t}\n-\t}\n-\tif (use_filecopy) {\n-\t\tint ifd, ofd, status = 0;\n-\n-\t\tifd = open(source, O_RDONLY);\n-\t\tif (ifd < 0) {\n-\t\t\tif (!warn_if_not_exists && errno == ENOENT)\n-\t\t\t\treturn -1;\n-\t\t\treturn error(\"cannot open %s\", source);\n-\t\t}\n-\t\tofd = open(dest, O_WRONLY | O_CREAT | O_EXCL, 0666);\n-\t\tif (ofd < 0) {\n-\t\t\tclose(ifd);\n-\t\t\treturn error(\"cannot open %s\", dest);\n-\t\t}\n-\t\tstatus = copy_fd(ifd, ofd);\n-\t\tclose(ofd);\n-\t\tif (status)\n-\t\t\treturn error(\"cannot write %s\", dest);\n-\t\tpull_say(\"copy %s\\n\", hex);\n-\t\treturn 0;\n-\t}\n-\treturn error(\"failed to copy %s with given copy methods.\", hex);\n-}\n-\n-static int fetch_pack(const unsigned char *sha1)\n-{\n-\tstruct packed_git *target;\n-\tchar filename[PATH_MAX];\n-\tif (setup_indices())\n-\t\treturn -1;\n-\ttarget = find_sha1_pack(sha1, packs);\n-\tif (!target)\n-\t\treturn error(\"Couldn't find %s: not separate or in any pack\",\n-\t\t\t     sha1_to_hex(sha1));\n-\tif (get_verbosely) {\n-\t\tfprintf(stderr, \"Getting pack %s\\n\",\n-\t\t\tsha1_to_hex(target->sha1));\n-\t\tfprintf(stderr, \" which contains %s\\n\",\n-\t\t\tsha1_to_hex(sha1));\n-\t}\n-\tsprintf(filename, \"%s/objects/pack/pack-%s.pack\",\n-\t\tpath, sha1_to_hex(target->sha1));\n-\tcopy_file(filename, sha1_pack_name(target->sha1),\n-\t\t  sha1_to_hex(target->sha1), 1);\n-\tsprintf(filename, \"%s/objects/pack/pack-%s.idx\",\n-\t\tpath, sha1_to_hex(target->sha1));\n-\tcopy_file(filename, sha1_pack_index_name(target->sha1),\n-\t\t  sha1_to_hex(target->sha1), 1);\n-\tinstall_packed_git(target);\n-\treturn 0;\n-}\n-\n-static int fetch_file(const unsigned char *sha1)\n-{\n-\tstatic int object_name_start = -1;\n-\tstatic char filename[PATH_MAX];\n-\tchar *hex = sha1_to_hex(sha1);\n-\tchar *dest_filename = sha1_file_name(sha1);\n-\n-\tif (object_name_start < 0) {\n-\t\tstrcpy(filename, path); /* e.g. git.git */\n-\t\tstrcat(filename, \"/objects/\");\n-\t\tobject_name_start = strlen(filename);\n-\t}\n-\tfilename[object_name_start+0] = hex[0];\n-\tfilename[object_name_start+1] = hex[1];\n-\tfilename[object_name_start+2] = '/';\n-\tstrcpy(filename + object_name_start + 3, hex + 2);\n-\treturn copy_file(filename, dest_filename, hex, 0);\n-}\n-\n-int fetch(unsigned char *sha1)\n-{\n-\tif (has_sha1_file(sha1))\n-\t\treturn 0;\n-\telse\n-\t\treturn fetch_file(sha1) && fetch_pack(sha1);\n-}\n-\n-int fetch_ref(char *ref, unsigned char *sha1)\n-{\n-\tstatic int ref_name_start = -1;\n-\tstatic char filename[PATH_MAX];\n-\tstatic char hex[41];\n-\tint ifd;\n-\n-\tif (ref_name_start < 0) {\n-\t\tsprintf(filename, \"%s/refs/\", path);\n-\t\tref_name_start = strlen(filename);\n-\t}\n-\tstrcpy(filename + ref_name_start, ref);\n-\tifd = open(filename, O_RDONLY);\n-\tif (ifd < 0) {\n-\t\tclose(ifd);\n-\t\treturn error(\"cannot open %s\", filename);\n-\t}\n-\tif (read_in_full(ifd, hex, 40) != 40 || get_sha1_hex(hex, sha1)) {\n-\t\tclose(ifd);\n-\t\treturn error(\"cannot read from %s\", filename);\n-\t}\n-\tclose(ifd);\n-\tpull_say(\"ref %s\\n\", sha1_to_hex(sha1));\n-\treturn 0;\n-}\n-\n-static const char local_pull_usage[] =\n-\"git-local-fetch [-c] [-t] [-a] [-v] [-w filename] [--recover] [-l] [-s] [-n] [--stdin] commit-id path\";\n-\n-/*\n- * By default we only use file copy.\n- * If -l is specified, a hard link is attempted.\n- * If -s is specified, then a symlink is attempted.\n- * If -n is _not_ specified, then a regular file-to-file copy is done.\n- */\n-int main(int argc, const char **argv)\n-{\n-\tint commits;\n-\tconst char **write_ref = NULL;\n-\tchar **commit_id;\n-\tint arg = 1;\n-\n-\tsetup_git_directory();\n-\tgit_config(git_default_config);\n-\n-\twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 't')\n-\t\t\tget_tree = 1;\n-\t\telse if (argv[arg][1] == 'c')\n-\t\t\tget_history = 1;\n-\t\telse if (argv[arg][1] == 'a') {\n-\t\t\tget_all = 1;\n-\t\t\tget_tree = 1;\n-\t\t\tget_history = 1;\n-\t\t}\n-\t\telse if (argv[arg][1] == 'l')\n-\t\t\tuse_link = 1;\n-\t\telse if (argv[arg][1] == 's')\n-\t\t\tuse_symlink = 1;\n-\t\telse if (argv[arg][1] == 'n')\n-\t\t\tuse_filecopy = 0;\n-\t\telse if (argv[arg][1] == 'v')\n-\t\t\tget_verbosely = 1;\n-\t\telse if (argv[arg][1] == 'w')\n-\t\t\twrite_ref = &argv[++arg];\n-\t\telse if (!strcmp(argv[arg], \"--recover\"))\n-\t\t\tget_recover = 1;\n-\t\telse if (!strcmp(argv[arg], \"--stdin\"))\n-\t\t\tcommits_on_stdin = 1;\n-\t\telse\n-\t\t\tusage(local_pull_usage);\n-\t\targ++;\n-\t}\n-\tif (argc < arg + 2 - commits_on_stdin)\n-\t\tusage(local_pull_usage);\n-\tif (commits_on_stdin) {\n-\t\tcommits = pull_targets_stdin(&commit_id, &write_ref);\n-\t} else {\n-\t\tcommit_id = (char **) &argv[arg++];\n-\t\tcommits = 1;\n-\t}\n-\tpath = argv[arg];\n-\n-\tif (pull(commits, commit_id, write_ref, path))\n-\t\treturn 1;\n-\n-\tif (commits_on_stdin)\n-\t\tpull_targets_free(commits, commit_id, write_ref);\n-\n-\treturn 0;\n-}\ndiff --git a/rsh.c b/rsh.c\ndeleted file mode 100644\nindex 5754a23..0000000\n--- a/rsh.c\n+++ /dev/null\n@@ -1,83 +0,0 @@\n-#include \"cache.h\"\n-#include \"rsh.h\"\n-#include \"quote.h\"\n-\n-#define COMMAND_SIZE 4096\n-\n-int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,\n-\t\t     char *url, int rmt_argc, char **rmt_argv)\n-{\n-\tchar *host;\n-\tchar *path;\n-\tint sv[2];\n-\tchar command[COMMAND_SIZE];\n-\tchar *posn;\n-\tint sizen;\n-\tint of;\n-\tint i;\n-\tpid_t pid;\n-\n-\tif (!strcmp(url, \"-\")) {\n-\t\t*fd_in = 0;\n-\t\t*fd_out = 1;\n-\t\treturn 0;\n-\t}\n-\n-\thost = strstr(url, \"//\");\n-\tif (host) {\n-\t\thost += 2;\n-\t\tpath = strchr(host, '/');\n-\t} else {\n-\t\thost = url;\n-\t\tpath = strchr(host, ':');\n-\t\tif (path)\n-\t\t\t*(path++) = '\\0';\n-\t}\n-\tif (!path) {\n-\t\treturn error(\"Bad URL: %s\", url);\n-\t}\n-\t/* $GIT_RSH <host> \"env GIT_DIR=<path> <remote_prog> <args...>\" */\n-\tsizen = COMMAND_SIZE;\n-\tposn = command;\n-\tof = 0;\n-\tof |= add_to_string(&posn, &sizen, \"env \", 0);\n-\tof |= add_to_string(&posn, &sizen, GIT_DIR_ENVIRONMENT \"=\", 0);\n-\tof |= add_to_string(&posn, &sizen, path, 1);\n-\tof |= add_to_string(&posn, &sizen, \" \", 0);\n-\tof |= add_to_string(&posn, &sizen, remote_prog, 1);\n-\n-\tfor ( i = 0 ; i < rmt_argc ; i++ ) {\n-\t\tof |= add_to_string(&posn, &sizen, \" \", 0);\n-\t\tof |= add_to_string(&posn, &sizen, rmt_argv[i], 1);\n-\t}\n-\n-\tof |= add_to_string(&posn, &sizen, \" -\", 0);\n-\n-\tif ( of )\n-\t\treturn error(\"Command line too long\");\n-\n-\tif (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))\n-\t\treturn error(\"Couldn't create socket\");\n-\n-\tpid = fork();\n-\tif (pid < 0)\n-\t\treturn error(\"Couldn't fork\");\n-\tif (!pid) {\n-\t\tconst char *ssh, *ssh_basename;\n-\t\tssh = getenv(\"GIT_SSH\");\n-\t\tif (!ssh) ssh = \"ssh\";\n-\t\tssh_basename = strrchr(ssh, '/');\n-\t\tif (!ssh_basename)\n-\t\t\tssh_basename = ssh;\n-\t\telse\n-\t\t\tssh_basename++;\n-\t\tclose(sv[1]);\n-\t\tdup2(sv[0], 0);\n-\t\tdup2(sv[0], 1);\n-\t\texeclp(ssh, ssh_basename, host, command, NULL);\n-\t}\n-\tclose(sv[0]);\n-\t*fd_in = sv[1];\n-\t*fd_out = sv[1];\n-\treturn 0;\n-}\ndiff --git a/rsh.h b/rsh.h\ndeleted file mode 100644\nindex ee2f499..0000000\n--- a/rsh.h\n+++ /dev/null\n@@ -1,7 +0,0 @@\n-#ifndef RSH_H\n-#define RSH_H\n-\n-int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,\n-\t\t     char *url, int rmt_argc, char **rmt_argv);\n-\n-#endif\ndiff --git a/ssh-fetch.c b/ssh-fetch.c\ndeleted file mode 100644\nindex bdf51a7..0000000\n--- a/ssh-fetch.c\n+++ /dev/null\n@@ -1,166 +0,0 @@\n-#ifndef COUNTERPART_ENV_NAME\n-#define COUNTERPART_ENV_NAME \"GIT_SSH_UPLOAD\"\n-#endif\n-#ifndef COUNTERPART_PROGRAM_NAME\n-#define COUNTERPART_PROGRAM_NAME \"git-ssh-upload\"\n-#endif\n-#ifndef MY_PROGRAM_NAME\n-#define MY_PROGRAM_NAME \"git-ssh-fetch\"\n-#endif\n-\n-#include \"cache.h\"\n-#include \"commit.h\"\n-#include \"rsh.h\"\n-#include \"fetch.h\"\n-#include \"refs.h\"\n-\n-static int fd_in;\n-static int fd_out;\n-\n-static unsigned char remote_version;\n-static unsigned char local_version = 1;\n-\n-static int prefetches;\n-\n-static struct object_list *in_transit;\n-static struct object_list **end_of_transit = &in_transit;\n-\n-void prefetch(unsigned char *sha1)\n-{\n-\tchar type = 'o';\n-\tstruct object_list *node;\n-\tif (prefetches > 100) {\n-\t\tfetch(in_transit->item->sha1);\n-\t}\n-\tnode = xmalloc(sizeof(struct object_list));\n-\tnode->next = NULL;\n-\tnode->item = lookup_unknown_object(sha1);\n-\t*end_of_transit = node;\n-\tend_of_transit = &node->next;\n-\t/* XXX: what if these writes fail? */\n-\twrite_in_full(fd_out, &type, 1);\n-\twrite_in_full(fd_out, sha1, 20);\n-\tprefetches++;\n-}\n-\n-static char conn_buf[4096];\n-static size_t conn_buf_posn;\n-\n-int fetch(unsigned char *sha1)\n-{\n-\tint ret;\n-\tsigned char remote;\n-\tstruct object_list *temp;\n-\n-\tif (hashcmp(sha1, in_transit->item->sha1)) {\n-\t\t/* we must have already fetched it to clean the queue */\n-\t\treturn has_sha1_file(sha1) ? 0 : -1;\n-\t}\n-\tprefetches--;\n-\ttemp = in_transit;\n-\tin_transit = in_transit->next;\n-\tif (!in_transit)\n-\t\tend_of_transit = &in_transit;\n-\tfree(temp);\n-\n-\tif (conn_buf_posn) {\n-\t\tremote = conn_buf[0];\n-\t\tmemmove(conn_buf, conn_buf + 1, --conn_buf_posn);\n-\t} else {\n-\t\tif (xread(fd_in, &remote, 1) < 1)\n-\t\t\treturn -1;\n-\t}\n-\t/* fprintf(stderr, \"Got %d\\n\", remote); */\n-\tif (remote < 0)\n-\t\treturn remote;\n-\tret = write_sha1_from_fd(sha1, fd_in, conn_buf, 4096, &conn_buf_posn);\n-\tif (!ret)\n-\t\tpull_say(\"got %s\\n\", sha1_to_hex(sha1));\n-\treturn ret;\n-}\n-\n-static int get_version(void)\n-{\n-\tchar type = 'v';\n-\tif (write_in_full(fd_out, &type, 1) != 1 ||\n-\t    write_in_full(fd_out, &local_version, 1)) {\n-\t\treturn error(\"Couldn't request version from remote end\");\n-\t}\n-\tif (xread(fd_in, &remote_version, 1) < 1) {\n-\t\treturn error(\"Couldn't read version from remote end\");\n-\t}\n-\treturn 0;\n-}\n-\n-int fetch_ref(char *ref, unsigned char *sha1)\n-{\n-\tsigned char remote;\n-\tchar type = 'r';\n-\tint length = strlen(ref) + 1;\n-\tif (write_in_full(fd_out, &type, 1) != 1 ||\n-\t    write_in_full(fd_out, ref, length) != length)\n-\t\treturn -1;\n-\n-\tif (read_in_full(fd_in, &remote, 1) != 1)\n-\t\treturn -1;\n-\tif (remote < 0)\n-\t\treturn remote;\n-\tif (read_in_full(fd_in, sha1, 20) != 20)\n-\t\treturn -1;\n-\treturn 0;\n-}\n-\n-static const char ssh_fetch_usage[] =\n-  MY_PROGRAM_NAME\n-  \" [-c] [-t] [-a] [-v] [--recover] [-w ref] commit-id url\";\n-int main(int argc, char **argv)\n-{\n-\tconst char *write_ref = NULL;\n-\tchar *commit_id;\n-\tchar *url;\n-\tint arg = 1;\n-\tconst char *prog;\n-\n-\tprog = getenv(\"GIT_SSH_PUSH\");\n-\tif (!prog) prog = \"git-ssh-upload\";\n-\n-\tsetup_git_directory();\n-\tgit_config(git_default_config);\n-\n-\twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 't') {\n-\t\t\tget_tree = 1;\n-\t\t} else if (argv[arg][1] == 'c') {\n-\t\t\tget_history = 1;\n-\t\t} else if (argv[arg][1] == 'a') {\n-\t\t\tget_all = 1;\n-\t\t\tget_tree = 1;\n-\t\t\tget_history = 1;\n-\t\t} else if (argv[arg][1] == 'v') {\n-\t\t\tget_verbosely = 1;\n-\t\t} else if (argv[arg][1] == 'w') {\n-\t\t\twrite_ref = argv[arg + 1];\n-\t\t\targ++;\n-\t\t} else if (!strcmp(argv[arg], \"--recover\")) {\n-\t\t\tget_recover = 1;\n-\t\t}\n-\t\targ++;\n-\t}\n-\tif (argc < arg + 2) {\n-\t\tusage(ssh_fetch_usage);\n-\t\treturn 1;\n-\t}\n-\tcommit_id = argv[arg];\n-\turl = argv[arg + 1];\n-\n-\tif (setup_connection(&fd_in, &fd_out, prog, url, arg, argv + 1))\n-\t\treturn 1;\n-\n-\tif (get_version())\n-\t\treturn 1;\n-\n-\tif (pull(1, &commit_id, &write_ref, url))\n-\t\treturn 1;\n-\n-\treturn 0;\n-}\ndiff --git a/ssh-pull.c b/ssh-pull.c\ndeleted file mode 100644\nindex 868ce4d..0000000\n--- a/ssh-pull.c\n+++ /dev/null\n@@ -1,4 +0,0 @@\n-#define COUNTERPART_ENV_NAME \"GIT_SSH_PUSH\"\n-#define COUNTERPART_PROGRAM_NAME \"git-ssh-push\"\n-#define MY_PROGRAM_NAME \"git-ssh-pull\"\n-#include \"ssh-fetch.c\"\ndiff --git a/ssh-push.c b/ssh-push.c\ndeleted file mode 100644\nindex a562df1..0000000\n--- a/ssh-push.c\n+++ /dev/null\n@@ -1,4 +0,0 @@\n-#define COUNTERPART_ENV_NAME \"GIT_SSH_PULL\"\n-#define COUNTERPART_PROGRAM_NAME \"git-ssh-pull\"\n-#define MY_PROGRAM_NAME \"git-ssh-push\"\n-#include \"ssh-upload.c\"\ndiff --git a/ssh-upload.c b/ssh-upload.c\ndeleted file mode 100644\nindex 20c35f0..0000000\n--- a/ssh-upload.c\n+++ /dev/null\n@@ -1,143 +0,0 @@\n-#ifndef COUNTERPART_ENV_NAME\n-#define COUNTERPART_ENV_NAME \"GIT_SSH_FETCH\"\n-#endif\n-#ifndef COUNTERPART_PROGRAM_NAME\n-#define COUNTERPART_PROGRAM_NAME \"git-ssh-fetch\"\n-#endif\n-#ifndef MY_PROGRAM_NAME\n-#define MY_PROGRAM_NAME \"git-ssh-upload\"\n-#endif\n-\n-#include \"cache.h\"\n-#include \"rsh.h\"\n-#include \"refs.h\"\n-\n-static unsigned char local_version = 1;\n-static unsigned char remote_version;\n-\n-static int verbose;\n-\n-static int serve_object(int fd_in, int fd_out) {\n-\tssize_t size;\n-\tunsigned char sha1[20];\n-\tsigned char remote;\n-\n-\tsize = read_in_full(fd_in, sha1, 20);\n-\tif (size < 0) {\n-\t\tperror(\"git-ssh-upload: read \");\n-\t\treturn -1;\n-\t}\n-\tif (!size)\n-\t\treturn -1;\n-\n-\tif (verbose)\n-\t\tfprintf(stderr, \"Serving %s\\n\", sha1_to_hex(sha1));\n-\n-\tremote = 0;\n-\n-\tif (!has_sha1_file(sha1)) {\n-\t\tfprintf(stderr, \"git-ssh-upload: could not find %s\\n\",\n-\t\t\tsha1_to_hex(sha1));\n-\t\tremote = -1;\n-\t}\n-\n-\tif (write_in_full(fd_out, &remote, 1) != 1)\n-\t\treturn 0;\n-\n-\tif (remote < 0)\n-\t\treturn 0;\n-\n-\treturn write_sha1_to_fd(fd_out, sha1);\n-}\n-\n-static int serve_version(int fd_in, int fd_out)\n-{\n-\tif (xread(fd_in, &remote_version, 1) < 1)\n-\t\treturn -1;\n-\twrite_in_full(fd_out, &local_version, 1);\n-\treturn 0;\n-}\n-\n-static int serve_ref(int fd_in, int fd_out)\n-{\n-\tchar ref[PATH_MAX];\n-\tunsigned char sha1[20];\n-\tint posn = 0;\n-\tsigned char remote = 0;\n-\tdo {\n-\t\tif (posn >= PATH_MAX || xread(fd_in, ref + posn, 1) < 1)\n-\t\t\treturn -1;\n-\t\tposn++;\n-\t} while (ref[posn - 1]);\n-\n-\tif (verbose)\n-\t\tfprintf(stderr, \"Serving %s\\n\", ref);\n-\n-\tif (get_ref_sha1(ref, sha1))\n-\t\tremote = -1;\n-\tif (write_in_full(fd_out, &remote, 1) != 1)\n-\t\treturn 0;\n-\tif (remote)\n-\t\treturn 0;\n-\twrite_in_full(fd_out, sha1, 20);\n-        return 0;\n-}\n-\n-\n-static void service(int fd_in, int fd_out) {\n-\tchar type;\n-\tssize_t retval;\n-\tdo {\n-\t\tretval = xread(fd_in, &type, 1);\n-\t\tif (retval < 1) {\n-\t\t\tif (retval < 0)\n-\t\t\t\tperror(\"git-ssh-upload: read \");\n-\t\t\treturn;\n-\t\t}\n-\t\tif (type == 'v' && serve_version(fd_in, fd_out))\n-\t\t\treturn;\n-\t\tif (type == 'o' && serve_object(fd_in, fd_out))\n-\t\t\treturn;\n-\t\tif (type == 'r' && serve_ref(fd_in, fd_out))\n-\t\t\treturn;\n-\t} while (1);\n-}\n-\n-static const char ssh_push_usage[] =\n-\tMY_PROGRAM_NAME \" [-c] [-t] [-a] [-w ref] commit-id url\";\n-\n-int main(int argc, char **argv)\n-{\n-\tint arg = 1;\n-        char *commit_id;\n-        char *url;\n-\tint fd_in, fd_out;\n-\tconst char *prog;\n-\tunsigned char sha1[20];\n-\tchar hex[41];\n-\n-\tprog = getenv(COUNTERPART_ENV_NAME);\n-\tif (!prog) prog = COUNTERPART_PROGRAM_NAME;\n-\n-\tsetup_git_directory();\n-\n-\twhile (arg < argc && argv[arg][0] == '-') {\n-\t\tif (argv[arg][1] == 'w')\n-\t\t\targ++;\n-                arg++;\n-        }\n-\tif (argc < arg + 2)\n-\t\tusage(ssh_push_usage);\n-\tcommit_id = argv[arg];\n-\turl = argv[arg + 1];\n-\tif (get_sha1(commit_id, sha1))\n-\t\tdie(\"Not a valid object name %s\", commit_id);\n-\tmemcpy(hex, sha1_to_hex(sha1), sizeof(hex));\n-\targv[arg] = hex;\n-\n-\tif (setup_connection(&fd_in, &fd_out, prog, url, arg, argv + 1))\n-\t\treturn 1;\n-\n-\tservice(fd_in, fd_out);\n-\treturn 0;\n-}\n-- \n1.5.2.2.1391.gcad2-dirty\n"},{"id":"46333","messageId":"7vwsxiroqa.fsf@assigned-by-dhcp.cox.net","threadId":"8826","inReplyTo":"Pine.LNX.4.64.0707030128110.14638@iabervon.org","subject":"Re: [PATCH 1/2] Remove obsolete commit-walkers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-03T06:22:05Z","receivedAt":"2007-07-03T06:22:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I'll apply this after 1.5.3.  In the meantime, I'll do this for 1.5.3.\n\ndiff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt\nindex 19b5f88..141b767 100644\n--- a/Documentation/git-local-fetch.txt\n+++ b/Documentation/git-local-fetch.txt\n@@ -14,6 +14,8 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n+THIS COMMAND IS DEPRECATED.\n+\n Duplicates another git repository on a local system.\n \n OPTIONS\ndiff --git a/Documentation/git-ssh-fetch.txt b/Documentation/git-ssh-fetch.txt\nindex aaf3db0..8d3e2ff 100644\n--- a/Documentation/git-ssh-fetch.txt\n+++ b/Documentation/git-ssh-fetch.txt\n@@ -13,6 +13,8 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n+THIS COMMAND IS DEPRECATED.\n+\n Pulls from a remote repository over ssh connection, invoking\n git-ssh-upload on the other end. It functions identically to\n git-ssh-upload, aside from which end you run it on.\ndiff --git a/Documentation/git-ssh-upload.txt b/Documentation/git-ssh-upload.txt\nindex 4796224..5e2ca8d 100644\n--- a/Documentation/git-ssh-upload.txt\n+++ b/Documentation/git-ssh-upload.txt\n@@ -12,6 +12,8 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n+THIS COMMAND IS DEPRECATED.\n+\n Pushes from a remote repository over ssh connection, invoking\n git-ssh-fetch on the other end. It functions identically to\n git-ssh-fetch, aside from which end you run it on.\n"},{"id":"46358","messageId":"18058.17778.692974.122271@lisa.zopyra.com","threadId":"8826","inReplyTo":"7vwsxiroqa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Remove obsolete commit-walkers","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-07-03T12:47:46Z","receivedAt":"2007-07-03T12:47:46Z","isPatch":true,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, July 2, 2007 at 23:22:05 (-0700) Junio C Hamano writes:\n>I'll apply this after 1.5.3.  In the meantime, I'll do this for 1.5.3.\n>\n>diff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt\n>index 19b5f88..141b767 100644\n>--- a/Documentation/git-local-fetch.txt\n>+++ b/Documentation/git-local-fetch.txt\n>@@ -14,6 +14,8 @@ SYNOPSIS\n> \n> DESCRIPTION\n> -----------\n>+THIS COMMAND IS DEPRECATED.\n>...\n\nIf a deprecated command has a replacement, the deprecation notice\nshould point the user to that.\n\n\nBill\n"},{"id":"46434","messageId":"7vsl84lpo3.fsf@assigned-by-dhcp.cox.net","threadId":"8826","inReplyTo":"18058.17778.692974.122271@lisa.zopyra.com","subject":"Re: [PATCH 1/2] Remove obsolete commit-walkers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-04T05:10:36Z","receivedAt":"2007-07-04T05:10:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> On Monday, July 2, 2007 at 23:22:05 (-0700) Junio C Hamano writes:\n>>I'll apply this after 1.5.3.  In the meantime, I'll do this for 1.5.3.\n>>\n>>diff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt\n>>index 19b5f88..141b767 100644\n>>--- a/Documentation/git-local-fetch.txt\n>>+++ b/Documentation/git-local-fetch.txt\n>>@@ -14,6 +14,8 @@ SYNOPSIS\n>> \n>> DESCRIPTION\n>> -----------\n>>+THIS COMMAND IS DEPRECATED.\n>>...\n>\n> If a deprecated command has a replacement, the deprecation notice\n> should point the user to that.\n\nActually these fetch backend shouldn't even be needed by the end\nusers.  \"git fetch\" simply does not drive them these days.\n"},{"id":"46468","messageId":"Pine.LNX.4.64.0707041228290.4071@racer.site","threadId":"8826","inReplyTo":"7vsl84lpo3.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] Remove obsolete commit-walkers","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-04T11:29:21Z","receivedAt":"2007-07-04T11:29:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Jul 2007, Junio C Hamano wrote:\n\n> Bill Lear <rael@zopyra.com> writes:\n> \n> > On Monday, July 2, 2007 at 23:22:05 (-0700) Junio C Hamano writes:\n> >>I'll apply this after 1.5.3.  In the meantime, I'll do this for 1.5.3.\n> >>\n> >>diff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt\n> >>index 19b5f88..141b767 100644\n> >>--- a/Documentation/git-local-fetch.txt\n> >>+++ b/Documentation/git-local-fetch.txt\n> >>@@ -14,6 +14,8 @@ SYNOPSIS\n> >> \n> >> DESCRIPTION\n> >> -----------\n> >>+THIS COMMAND IS DEPRECATED.\n> >>...\n> >\n> > If a deprecated command has a replacement, the deprecation notice\n> > should point the user to that.\n> \n> Actually these fetch backend shouldn't even be needed by the end\n> users.  \"git fetch\" simply does not drive them these days.\n\nYou forget that this backend is a plumbing component, which might well be \nused by other porcelains. IIRC cogito uses it, optionally.\n\nCiao,\nDscho\n"},{"id":"46496","messageId":"7vabuchzt4.fsf@assigned-by-dhcp.cox.net","threadId":"8826","inReplyTo":"Pine.LNX.4.64.0707041228290.4071@racer.site","subject":"Re: [PATCH 1/2] Remove obsolete commit-walkers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-04T16:57:27Z","receivedAt":"2007-07-04T16:57:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Actually these fetch backend shouldn't even be needed by the end\n>> users.  \"git fetch\" simply does not drive them these days.\n>\n> You forget that this backend is a plumbing component, which might well be \n> used by other porcelains. IIRC cogito uses it, optionally.\n\nYou are correct that these plumbing commands can be called by\nCogito, but we are not removing them but merely deprecating\nthem.  And I thought Cogito itself is deprecated these days,\nso...\n"}]}