{"thread":{"id":"22084","subject":"[PATCH] Use warning function instead of fprintf(stderr, \"Warning: ...\").","startedAt":"2010-01-02T20:24:46Z","lastAt":"2010-01-04T16:02:48Z","messageCount":2,"participants":["Thiago Farina","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130700","messageId":"1262463886-8956-1-git-send-email-tfransosi@gmail.com","threadId":"22084","inReplyTo":null,"subject":"[PATCH] Use warning function instead of fprintf(stderr, \"Warning: ...\").","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2010-01-02T20:24:46Z","receivedAt":"2010-01-02T20:24:46Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"Signed-off-by: Thiago Farina <tfransosi@gmail.com>\n---\n bisect.c     |    2 +-\n builtin-mv.c |    4 +---\n http.c       |    2 +-\n 3 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex dc18db8..d1f8c42 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -813,7 +813,7 @@ static void handle_skipped_merge_base(const unsigned char *mb)\n \tchar *bad_hex = sha1_to_hex(current_bad_sha1);\n \tchar *good_hex = join_sha1_array_hex(&good_revs, ' ');\n \n-\tfprintf(stderr, \"Warning: the merge base between %s and [%s] \"\n+\twarning(\"the merge base between %s and [%s] \"\n \t\t\"must be skipped.\\n\"\n \t\t\"So we cannot be sure the first bad commit is \"\n \t\t\"between %s and %s.\\n\"\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex f633d81..8ad7245 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -169,9 +169,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t\t * check both source and destination\n \t\t\t\t */\n \t\t\t\tif (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {\n-\t\t\t\t\tfprintf(stderr, \"Warning: %s;\"\n-\t\t\t\t\t\t\t\" will overwrite!\\n\",\n-\t\t\t\t\t\t\tbad);\n+\t\t\t\t\twarning(\"%s; will overwrite!\\n\", bad);\n \t\t\t\t\tbad = NULL;\n \t\t\t\t} else\n \t\t\t\t\tbad = \"Cannot overwrite\";\ndiff --git a/http.c b/http.c\nindex ed6414a..afce7c3 100644\n--- a/http.c\n+++ b/http.c\n@@ -1244,7 +1244,7 @@ int finish_http_object_request(struct http_object_request *freq)\n \tprocess_http_object_request(freq);\n \n \tif (freq->http_code == 416) {\n-\t\tfprintf(stderr, \"Warning: requested range invalid; we may already have all the data.\\n\");\n+\t\twarning(\"requested range invalid; we may already have all the data.\\n\");\n \t} else if (freq->curl_result != CURLE_OK) {\n \t\tif (stat(freq->tmpfile, &st) == 0)\n \t\t\tif (st.st_size == 0)\n-- \n1.6.6.rc3\n"},{"id":"130775","messageId":"4B421128.5040807@kdbg.org","threadId":"22084","inReplyTo":"1262463886-8956-1-git-send-email-tfransosi@gmail.com","subject":"Re: [PATCH] Use warning function instead of fprintf(stderr, \"Warning: ...\").","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2010-01-04T16:02:48Z","receivedAt":"2010-01-04T16:02:48Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Did you actually test any of the changed warnings? You should see extra \nempty lines because warning() adds its own LF and you didn't remove any.\n\n-- Hannes\n"}]}