diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2010-11-17 09:15:34 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-19 11:04:20 -0800 |
commit | 7851b1e60fabe350216d48e6de03a3ed21a49953 (patch) | |
tree | 80880c61f51eb749bffd0034a4831e96a55fe57e | |
parent | git-remote-ext (diff) | |
download | tgif-7851b1e60fabe350216d48e6de03a3ed21a49953.tar.xz |
remote-fd/ext: finishing touches after code review
When compiling with pthread support, transport-helper.c needs to include
necessary header files. Also fix a few error messages in remote-ext and
remote-fd programs, and a potential buffer underrun in remote-fd.
In the documentation, clarify how %G and %V are used; the old description
looked as if they take repository/vhost parameters, which was wrong.
Also fix AsciiDoc markup for the page title of remote-fd/remote-ext manpages,
and tweak the way how section headers are shown.
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | Documentation/git-remote-ext.txt | 10 | ||||
-rw-r--r-- | Documentation/git-remote-fd.txt | 10 | ||||
-rw-r--r-- | builtin/remote-ext.c | 8 | ||||
-rw-r--r-- | builtin/remote-fd.c | 6 | ||||
-rw-r--r-- | transport-helper.c | 5 |
5 files changed, 21 insertions, 18 deletions
diff --git a/Documentation/git-remote-ext.txt b/Documentation/git-remote-ext.txt index 8fb260b54b..f4fbf67209 100644 --- a/Documentation/git-remote-ext.txt +++ b/Documentation/git-remote-ext.txt @@ -39,20 +39,20 @@ The following sequences have a special meaning: git-upload-pack, or git-upload-archive) of the service git wants to invoke. -'%G<repository>' (as argument):: +'%G' (must be first characters in argument):: This argument will not be passed to 'program'. Instead, it will cause helper to start by sending git:// service request to remote side with service field set to approiate value and - repository field set to <repository>. Default is not to send + repository field set to rest of the argument. Default is not to send such request. + This is useful if remote side is git:// server accessed over some tunnel. -'%V<host>' (as argument):: +'%V' (must be first characters in argument):: This argument will not be passed to 'program'. Instead it sets - the vhost field in git:// service request. Default is not to - send vhost in such request (if sent). + the vhost field in git:// service request (to rest of the argument). + Default is not to send vhost in such request (if sent). ENVIRONMENT VARIABLES: ---------------------- diff --git a/Documentation/git-remote-fd.txt b/Documentation/git-remote-fd.txt index 1c1a1795c7..abc49441be 100644 --- a/Documentation/git-remote-fd.txt +++ b/Documentation/git-remote-fd.txt @@ -1,5 +1,5 @@ git-remote-fd(1) -================= +================ NAME ---- @@ -28,13 +28,13 @@ It is assumed that any handshaking procedures have already been completed information to user in the URL in case that URL is displayed in some context. -ENVIRONMENT VARIABLES: ----------------------- +ENVIRONMENT VARIABLES +--------------------- GIT_TRANSLOOP_DEBUG:: If set, prints debugging information about various reads/writes. -EXAMPLES: ---------- +EXAMPLES +-------- git fetch fd::17 master:: Fetch master, using file descriptor #17 to communicate with git-upload-pack. diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c index 1d3f1cf3cc..1f773171cb 100644 --- a/builtin/remote-ext.c +++ b/builtin/remote-ext.c @@ -142,7 +142,7 @@ static const char **parse_argv(const char *arg, const char *service) for (i = 0; i < arguments; i++) ret[i] = temparray[i]; ret[arguments] = NULL; - return (const char **)ret; + return ret; } static void send_git_request(int stdin_fd, const char *serv, const char *repo, @@ -239,10 +239,8 @@ static int command_loop(const char *child) int cmd_remote_ext(int argc, const char **argv, const char *prefix) { - if (argc < 3) { - fprintf(stderr, "Error: URL missing"); - exit(1); - } + if (argc != 3) + die("Expected two arguments"); return command_loop(argv[2]); } diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c index 7517f2476c..1f2467bdb7 100644 --- a/builtin/remote-fd.c +++ b/builtin/remote-fd.c @@ -31,7 +31,7 @@ static void command_loop(int input_fd, int output_fd) } /* Strip end of line characters. */ i = strlen(buffer); - while (isspace(buffer[i - 1])) + while (i > 0 && isspace(buffer[i - 1])) buffer[--i] = 0; if (!strcmp(buffer, "capabilities")) { @@ -56,8 +56,8 @@ int cmd_remote_fd(int argc, const char **argv, const char *prefix) int output_fd = -1; char *end; - if (argc < 3) - die("URL missing"); + if (argc != 3) + die("Expected two arguments"); input_fd = (int)strtoul(argv[2], &end, 10); diff --git a/transport-helper.c b/transport-helper.c index 0c094d66c1..3a50856318 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -9,6 +9,11 @@ #include "remote.h" #include "string-list.h" +#ifndef NO_PTHREADS +#include <pthread.h> +#include "thread-utils.h" +#endif + static int debug; struct helper_data |