summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0de68d2)
raw | patch | inline | side by side (parent: 0de68d2)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Sep 2005 21:56:37 +0000 (14:56 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Sep 2005 21:56:37 +0000 (14:56 -0700) |
HPA reminded me that these programs knows about the name of the
counterpart on the other end and simply symlinking the old name to
new name locally would not be enough.
Signed-off-by: Junio C Hamano <junkio@cox.net>
counterpart on the other end and simply symlinking the old name to
new name locally would not be enough.
Signed-off-by: Junio C Hamano <junkio@cox.net>
.gitignore | patch | blob | history | |
Makefile | patch | blob | history | |
cmd-rename.sh | patch | blob | history | |
ssh-fetch.c | patch | blob | history | |
ssh-pull.c | [new file with mode: 0644] | patch | blob |
ssh-push.c | [new file with mode: 0644] | patch | blob |
ssh-upload.c | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index 9fde27fb4fcbad7ec0ab7563057dc0f001d383b9..1d4a41159352935f39ed7c8442202e60f296ecd5 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-show-branch
git-show-index
git-ssh-fetch
+git-ssh-pull
+git-ssh-push
git-ssh-upload
git-status
git-stripspace
diff --git a/Makefile b/Makefile
index e8421ccc2de4e8aecd0ea8e56b12f1a8bd2c8c7b..b48fe44b384680fa2400c4963cb50371a3310ef1 100644 (file)
--- a/Makefile
+++ b/Makefile
git-upload-pack git-verify-pack git-write-tree \
$(SIMPLE_PROGRAMS)
+# Backward compatibility -- to be removed in 0.99.8
+PROGRAMS += git-ssh-pull git-ssh-push
+
PYMODULES = \
gitMergeCommon.py
git-local-fetch: fetch.o
git-ssh-fetch: rsh.o fetch.o
git-ssh-upload: rsh.o
+git-ssh-pull: rsh.o fetch.o
+git-ssh-push: rsh.o
git-http-fetch: LIBS += -lcurl
git-rev-list: LIBS += $(OPENSSL_LIBSSL)
diff --git a/cmd-rename.sh b/cmd-rename.sh
index 1edb037bea880d0f2e8fd47e01d3642838dabcaa..ada33fb51d13999319f438db3f8437713330a9a3 100755 (executable)
--- a/cmd-rename.sh
+++ b/cmd-rename.sh
git-verify-tag-script git-verify-tag
git-http-pull git-http-fetch
git-local-pull git-local-fetch
-git-ssh-pull git-ssh-fetch
git-checkout-cache git-checkout-index
git-diff-cache git-diff-index
git-merge-cache git-merge-index
git-update-cache git-update-index
-git-ssh-push git-ssh-upload
git-convert-cache git-convert-objects
git-fsck-cache git-fsck-objects
EOF
+
+# These two are a bit more than symlinks now.
+# git-ssh-push git-ssh-upload
+# git-ssh-pull git-ssh-fetch
diff --git a/ssh-fetch.c b/ssh-fetch.c
index d8f4368bc5eb09c3303a2a9cdbfb5bf395a6dcdf..683a1e4a01f250043324ae49fe61cc33470ceb9c 100644 (file)
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
+#ifndef COUNTERPART_ENV_NAME
+#define COUNTERPART_ENV_NAME "GIT_SSH_UPLOAD"
+#endif
+#ifndef COUNTERPART_PROGRAM_NAME
+#define COUNTERPART_PROGRAM_NAME "git-ssh-upload"
+#endif
+#ifndef MY_PROGRAM_NAME
+#define MY_PROGRAM_NAME "git-ssh-fetch"
+#endif
+
#include "cache.h"
#include "commit.h"
#include "rsh.h"
return 0;
}
+static const char ssh_fetch_usage[] =
+ MY_PROGRAM_NAME
+ " [-c] [-t] [-a] [-v] [-d] [--recover] [-w ref] commit-id url";
int main(int argc, char **argv)
{
char *commit_id;
arg++;
}
if (argc < arg + 2) {
- usage("git-ssh-fetch [-c] [-t] [-a] [-v] [-d] [--recover] [-w ref] commit-id url");
+ usage(ssh_fetch_usage);
return 1;
}
commit_id = argv[arg];
diff --git a/ssh-pull.c b/ssh-pull.c
--- /dev/null
+++ b/ssh-pull.c
@@ -0,0 +1,4 @@
+#define COUNTERPART_ENV_NAME "GIT_SSH_PUSH"
+#define COUNTERPART_PROGRAM_NAME "git-ssh-push"
+#define MY_PROGRAM_NAME "git-ssh-pull"
+#include "ssh-fetch.c"
diff --git a/ssh-push.c b/ssh-push.c
--- /dev/null
+++ b/ssh-push.c
@@ -0,0 +1,4 @@
+#define COUNTERPART_ENV_NAME "GIT_SSH_PULL"
+#define COUNTERPART_PROGRAM_NAME "git-ssh-pull"
+#define MY_PROGRAM_NAME "git-ssh-push"
+#include "ssh-upload.c"
diff --git a/ssh-upload.c b/ssh-upload.c
index 10a36873391b727a75e5f1d3a42d78acb62ed502..603abcc8c3da9029a50fb7a2e76b0d6f70e2abeb 100644 (file)
--- a/ssh-upload.c
+++ b/ssh-upload.c
+#ifndef COUNTERPART_ENV_NAME
+#define COUNTERPART_ENV_NAME "GIT_SSH_FETCH"
+#endif
+#ifndef COUNTERPART_PROGRAM_NAME
+#define COUNTERPART_PROGRAM_NAME "git-ssh-fetch"
+#endif
+#ifndef MY_PROGRAM_NAME
+#define MY_PROGRAM_NAME "git-ssh-upload"
+#endif
+
#include "cache.h"
#include "rsh.h"
#include "refs.h"
}
static const char ssh_push_usage[] =
- "git-ssh-upload [-c] [-t] [-a] [-w ref] commit-id url";
+ MY_PROGRAM_NAME " [-c] [-t] [-a] [-w ref] commit-id url";
int main(int argc, char **argv)
{
unsigned char sha1[20];
char hex[41];
- prog = getenv("GIT_SSH_PULL");
- if (!prog) prog = "git-ssh-fetch";
+ prog = getenv(COUNTERPART_ENV_NAME);
+ if (!prog) prog = COUNTERPART_PROGRAM_NAME;
while (arg < argc && argv[arg][0] == '-') {
if (argv[arg][1] == 'w')
arg++;