git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH v7 2/3] git-remote-fd
Date: Wed, 13 Oct 2010 16:33:45 -0700	[thread overview]
Message-ID: <7vzkuhfz1i.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1286901583-30088-3-git-send-email-ilari.liusvaara@elisanet.fi

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:

> diff --git a/Documentation/git-remote-fd.txt b/Documentation/git-remote-fd.txt
> new file mode 100644
> index 0000000..1c1a179
> --- /dev/null
> +++ b/Documentation/git-remote-fd.txt
> @@ -0,0 +1,59 @@
> +git-remote-fd(1)
> +=================

It appears to me that it has one equal sign too many.  Does this format
correctly?

> +ENVIRONMENT VARIABLES:
> +----------------------

I didn't follow the discussion closely but I recall somebody saying that
the final colon is out of place, and I think I agree.

> +EXAMPLES:
> +---------

Likewise.

> diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c
> new file mode 100644
> index 0000000..7517f24
> --- /dev/null
> +++ b/builtin/remote-fd.c
> @@ -0,0 +1,79 @@
> +#include "git-compat-util.h"
> +#include "transport.h"
> +
> +/*
> + * URL syntax:
> + *	'fd::<inoutfd>[/<anything>]'		Read/write socket pair
> + *						<inoutfd>.
> + *	'fd::<infd>,<outfd>[/<anything>]'	Read pipe <infd> and write
> + *						pipe <outfd>.
> + *	[foo] indicates 'foo' is optional. <anything> is any string.
> + *
> + * The data output to <outfd>/<inoutfd> should be passed unmolested to
> + * git-receive-pack/git-upload-pack/git-upload-archive and output of
> + * git-receive-pack/git-upload-pack/git-upload-archive should be passed
> + * unmolested to <infd>/<inoutfd>.
> + *
> + */
> +
> +#define MAXCOMMAND 4096
> +
> +static void command_loop(int input_fd, int output_fd)
> +{
> +	char buffer[MAXCOMMAND];
> +
> +	while (1) {
> +		size_t i;
> +		if (!fgets(buffer, MAXCOMMAND - 1, stdin)) {
> +			if (ferror(stdin))
> +				die("Input error");
> +			return;
> +		}
> +		/* Strip end of line characters. */
> +		i = strlen(buffer);
> +		while (isspace(buffer[i - 1]))
> +			buffer[--i] = 0;

Hopefully you won't get a line with all space, going beyond the beginning
of the buffer?

> +int cmd_remote_fd(int argc, const char **argv, const char *prefix)
> +{
> +	int input_fd = -1;
> +	int output_fd = -1;
> +	char *end;
> +
> +	if (argc < 3)
> +		die("URL missing");

Is it Ok to have excess arguments to be ignored?

  reply	other threads:[~2010-10-13 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 16:39 [RFC PATCH v7 0/3] git-remote-fd & git-remote-ext Ilari Liusvaara
2010-10-12 16:39 ` [RFC PATCH v7 1/3] Add bidirectional_transfer_loop() Ilari Liusvaara
2010-10-12 16:39 ` [RFC PATCH v7 2/3] git-remote-fd Ilari Liusvaara
2010-10-13 23:33   ` Junio C Hamano [this message]
2010-10-12 16:39 ` [RFC PATCH v7 3/3] git-remote-ext Ilari Liusvaara
2010-10-13 23:32   ` Junio C Hamano
2011-01-16  3:49   ` [PATCH] remote-ext: do not segfault for blank lines Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vzkuhfz1i.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ilari.liusvaara@elisanet.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).