git-ssh-push/pull: usability improvements
Allow traditional ssh path specifiers (host:path), and let the user
override the command name on the other end.
With this, I can push to kernel.org with this script
export GIT_SSH_PULL=/home/torvalds/bin/git-ssh-pull
git-ssh-push -a -v -w heads/master heads/master master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
which while not pretty is at least workable.
diff --git a/ssh-push.c b/ssh-push.c
index b67a95b..18c0b65 100644
--- a/ssh-push.c
+++ b/ssh-push.c
@@ -109,6 +109,8 @@
char *commit_id;
char *url;
int fd_in, fd_out;
+ const char *prog = getenv("GIT_SSH_PULL") ? : "git-ssh-pull";
+
while (arg < argc && argv[arg][0] == '-') {
if (argv[arg][1] == 'w')
arg++;
@@ -120,7 +122,7 @@
}
commit_id = argv[arg];
url = argv[arg + 1];
- if (setup_connection(&fd_in, &fd_out, "git-ssh-pull", url, arg, argv + 1))
+ if (setup_connection(&fd_in, &fd_out, prog, url, arg, argv + 1))
return 1;
service(fd_in, fd_out);