diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-07 14:23:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-07 14:23:46 -0700 |
commit | 001d4a27dbfaaa59c25dc35dafc69bd9b9bc21d3 (patch) | |
tree | b7b89d84be5025133535999f9c3644996ba6520a /rsh.c | |
parent | 972d1bb067d0cea6334da081f6a3e2a6bad6f20b (diff) | |
download | git-001d4a27dbfaaa59c25dc35dafc69bd9b9bc21d3.tar.gz git-001d4a27dbfaaa59c25dc35dafc69bd9b9bc21d3.tar.xz |
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.
Diffstat (limited to 'rsh.c')
-rw-r--r-- | rsh.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -8,7 +8,7 @@ #define COMMAND_SIZE 4096 -int setup_connection(int *fd_in, int *fd_out, char *remote_prog, +int setup_connection(int *fd_in, int *fd_out, const char *remote_prog, char *url, int rmt_argc, char **rmt_argv) { char *host; @@ -25,11 +25,13 @@ int setup_connection(int *fd_in, int *fd_out, char *remote_prog, } host = strstr(url, "//"); - if (!host) { - return error("Bad URL: %s", url); + if (host) { + host += 2; + path = strchr(host, '/'); + } else { + host = url; + path = strchr(host, ':'); } - host += 2; - path = strchr(host, '/'); if (!path) { return error("Bad URL: %s", url); } |