git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [REROLL PATCH 6/8] Support remote helpers implementing smart transports

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 8, 2009, 23:38 UTC
Message-ID
<7vein5594u.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1260278177-9029-7-git-send-email-ilari.liusvaara@elisanet.fi>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 18 quoted lines
> Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
> ---
>  Documentation/git-remote-helpers.txt |   25 +++++++-
>  transport-helper.c                   |  126 ++++++++++++++++++++++++++++++++--
>  2 files changed, 144 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt
> index 20a05fe..b957813 100644
> --- a/Documentation/git-remote-helpers.txt
> +++ b/Documentation/git-remote-helpers.txt
> @@ -93,6 +93,20 @@ Supported if the helper has the "push" capability.
>  +
>  Supported if the helper has the "import" capability.
>  
> +'connect' <service>::
> +	Connects to given service. Stdin and stdout of helper are

A minor point, but in prose, unless it explains how to use "stdin" and "stdout" as a variable, keyword, etc. in code, I'd prefer to see these spelled out, like so:

	The standard input and output of helpers are connected to ...
Show 7 quoted lines
> @@ -34,12 +36,12 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)
>  		die_errno("Full write to remote helper failed");
>  }
>  
> -static int recvline(struct helper_data *helper, struct strbuf *buffer)
> +static int _recvline(FILE *helper, struct strbuf *buffer)
>  {
Not a good naming for two reasons.
 - Somebody new to the code wouldn't be able to tell which of recvline()
   and _recvline() take helper_data and FILE easily.
 - A function name that starts with an underscore, even if it is file
   scoped static, is something we tend to avoid.  This applies to
   _process_connect() in the earlier patch as well.

recvline_fh() vs revline() might be better as most of the interaction in this layer are done on helper_data, which makes the name recvline() pair nicely with sendline that also takes helper_data; and the oddball one that is _not_ an implementation detail (i.e. you have calls outside recvline() implementation that call _recvline()) hints that it takes filehandle instead.

Previous: Ilari LiusvaaraNext: Ilari Liusvaara
Message 18 of 23 in “Remote helpers smart transport extensions”
  1. 0/8 Remote helpers smart transport extensionsIlari Liusvaara, Dec 8, 2009
  2. 1/8 Add remote helper debug modeIlari Liusvaara, Dec 8, 2009
  3. Junio C HamanoDec 8, 2009
  4. 2/8 Support mandatory capabilitiesIlari Liusvaara, Dec 8, 2009
  5. Junio C HamanoDec 8, 2009
  6. Ilari LiusvaaraDec 9, 2009
  7. 3/8 Pass unknown protocols to external protocol handlersIlari Liusvaara, Dec 8, 2009
  8. Junio C HamanoDec 8, 2009
  9. Bert WesargDec 9, 2009
  10. Ilari LiusvaaraDec 9, 2009
  11. 4/8 Refactor git transport options parsingIlari Liusvaara, Dec 8, 2009
  12. 5/8 Support taking over transportsIlari Liusvaara, Dec 8, 2009
  13. Junio C HamanoDec 8, 2009
  14. Ilari LiusvaaraDec 9, 2009
  15. Junio C HamanoDec 9, 2009
  16. Ilari LiusvaaraDec 9, 2009
  17. 6/8 Support remote helpers implementing smart transportsIlari Liusvaara, Dec 8, 2009
  18. Junio C HamanoDec 8, 2009
  19. Ilari LiusvaaraDec 9, 2009
  20. 7/8 Support remote archive from external protocol helpersIlari Liusvaara, Dec 8, 2009
  21. Junio C HamanoDec 8, 2009
  22. Ilari LiusvaaraDec 9, 2009
  23. 8/8 Remove special casing of http, https and ftpIlari Liusvaara, Dec 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.