{"thread":{"id":"22022","subject":"[Squash PATCH] fprintf(stderr, \"Warning...\") -> warning(\"...\")","startedAt":"2009-12-24T10:41:19Z","lastAt":"2009-12-28T09:24:05Z","messageCount":2,"participants":["Ilari Liusvaara","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130309","messageId":"1261651279-29041-1-git-send-email-ilari.liusvaara@elisanet.fi","threadId":"22022","inReplyTo":null,"subject":"[Squash PATCH] fprintf(stderr, \"Warning...\") -> warning(\"...\")","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2009-12-24T10:41:19Z","receivedAt":"2009-12-24T10:41:19Z","isPatch":true,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>\n---\n transport-helper.c |    7 +++----\n 1 files changed, 3 insertions(+), 4 deletions(-)\n\nThis fixes the small nit about fprintf(stderr, \"Warning: \") by using\nwarning() API. \n\nIt can be appiled on top of \"Support remote helpers implementing smart\ntransports\" or squashed to it.\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 55427df..8c8ca8e 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -420,11 +420,10 @@ static int process_connect_service(struct transport *transport,\n \tif (strcmp(name, exec)) {\n \t\tr = set_helper_option(transport, \"servpath\", exec);\n \t\tif (r > 0)\n-\t\t\tfprintf(stderr, \"Warning: Setting remote service path \"\n-\t\t\t\t\"not supported by protocol.\\n\");\n+\t\t\twarning(\"Setting remote service path not supported \"\n+\t\t\t\t\"by protocol.\\n\");\n \t\telse if (r < 0)\n-\t\t\tfprintf(stderr, \"Warning: Invalid remote service \"\n-\t\t\t\t\"path.\\n\");\n+\t\t\twarning(\"Invalid remote service path.\\n\");\n \t}\n \n \tif (data->connect)\n-- \n1.6.6.3.gaa2e1\n"},{"id":"130390","messageId":"7vy6kntpsa.fsf@alter.siamese.dyndns.org","threadId":"22022","inReplyTo":"1261651279-29041-1-git-send-email-ilari.liusvaara@elisanet.fi","subject":"Re: [Squash PATCH] fprintf(stderr, \"Warning...\") -> warning(\"...\")","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-28T09:24:05Z","receivedAt":"2009-12-28T09:24:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:\n\n> Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>\n> ---\n>  transport-helper.c |    7 +++----\n>  1 files changed, 3 insertions(+), 4 deletions(-)\n>\n> This fixes the small nit about fprintf(stderr, \"Warning: \") by using\n> warning() API. \n>\n> It can be appiled on top of \"Support remote helpers implementing smart\n> transports\" or squashed to it.\n\nThanks; will squash but with two minor touch-ups:\n\n - warning() adds its own terminating LF so we need to drop it from the caller;\n\n - being able to grep for an error/warning message is more important than\n   keeping the source line strictly shorter than 80-columns.\n\n> diff --git a/transport-helper.c b/transport-helper.c\n> index 55427df..8c8ca8e 100644\n> --- a/transport-helper.c\n> +++ b/transport-helper.c\n> @@ -420,11 +420,10 @@ static int process_connect_service(struct transport *transport,\n>  \tif (strcmp(name, exec)) {\n>  \t\tr = set_helper_option(transport, \"servpath\", exec);\n>  \t\tif (r > 0)\n> -\t\t\tfprintf(stderr, \"Warning: Setting remote service path \"\n> -\t\t\t\t\"not supported by protocol.\\n\");\n> +\t\t\twarning(\"Setting remote service path not supported \"\n> +\t\t\t\t\"by protocol.\\n\");\n>  \t\telse if (r < 0)\n> -\t\t\tfprintf(stderr, \"Warning: Invalid remote service \"\n> -\t\t\t\t\"path.\\n\");\n> +\t\t\twarning(\"Invalid remote service path.\\n\");\n>  \t}\n>  \n>  \tif (data->connect)\n> -- \n> 1.6.6.3.gaa2e1\n"}]}