{"thread":{"id":"17893","subject":"[PATCH 5/6] Change output \"error: \" to \"Error: \" etc","startedAt":"2009-02-19T07:36:49Z","lastAt":"2009-03-22T21:58:46Z","messageCount":19,"participants":["John Tapsell","Thomas Rast","Jeff King","Miklos Vajna","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"105404","messageId":"200902190736.49161.johnflux@gmail.com","threadId":"17893","inReplyTo":null,"subject":"[PATCH 5/6] Change output \"error: \" to \"Error: \" etc","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-02-19T07:36:49Z","receivedAt":"2009-02-19T07:36:49Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"All the error messages starting \"Error: \" begin with a captial E, except\nin one place.  This commit fixes this, making the output look more\nconsistent.  At the moment a failed push, say, looks like:\n\nError: cannot lock existing info/refs\nerror: failed to push some refs to 'some repository'\n\nSigned-off-by: John Tapsell <johnflux@gmail.com>\n---\n usage.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/usage.c b/usage.c\nindex 24f5fc0..acc4ee1 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -14,24 +14,24 @@ static void report(const char *prefix, const char *err, va_list params)\n \n static NORETURN void usage_builtin(const char *err)\n {\n-\tfprintf(stderr, \"usage: %s\\n\", err);\n+\tfprintf(stderr, \"Usage: %s\\n\", err);\n \texit(129);\n }\n \n static NORETURN void die_builtin(const char *err, va_list params)\n {\n-\treport(\"fatal: \", err, params);\n+\treport(\"Fatal: \", err, params);\n \texit(128);\n }\n \n static void error_builtin(const char *err, va_list params)\n {\n-\treport(\"error: \", err, params);\n+\treport(\"Error: \", err, params);\n }\n \n static void warn_builtin(const char *warn, va_list params)\n {\n-\treport(\"warning: \", warn, params);\n+\treport(\"Warning: \", warn, params);\n }\n \n /* If we are in a dlopen()ed .so write to a global variable would segfault\n-- \n1.6.2.rc1.3.g7d31b.dirty\n"},{"id":"105408","messageId":"200902190915.15227.trast@student.ethz.ch","threadId":"17893","inReplyTo":"200902190736.49161.johnflux@gmail.com","subject":"Re: [PATCH 5/6] Change output \"error: \" to \"Error: \" etc","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-19T08:14:57Z","receivedAt":"2009-02-19T08:14:57Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"John Tapsell wrote:\n> All the error messages starting \"Error: \" begin with a captial E, except\n> in one place.  This commit fixes this, making the output look more\n> consistent.  At the moment a failed push, say, looks like:\n> \n> Error: cannot lock existing info/refs\n> error: failed to push some refs to 'some repository'\n[...]\n> -\treport(\"fatal: \", err, params);\n> +\treport(\"Fatal: \", err, params);\n\nA quick grep says this is going to break the tests:\n\n  t/t1400-update-ref.sh:\t test \"warning: Log for '\\'master\\'' only goes back to $ed.\" = \"$(cat e)\"'\n  t/t1400-update-ref.sh:\t echo test \"warning: Log for '\\'master\\'' only goes back to $ed.\" = \"$(cat e)\"'\n  t/t1400-update-ref.sh:\t test \"warning: Log for '\\''master'\\'' only goes back to $ed.\" = \"$(cat e)\"'\n  t/t1400-update-ref.sh:\t test \"warning: Log .git/logs/'\"$m has gap after $gd\"'.\" = \"$(cat e)\"'\n  t/t1400-update-ref.sh:\t test \"warning: Log .git/logs/'\"$m unexpectedly ended on $ld\"'.\" = \"$(cat e)\"'\n  t/t4012-diff-binary.sh:\t detected=`expr \"$detected\" : \"fatal.*at line \\\\([0-9]*\\\\)\\$\"` &&\n  t/t4012-diff-binary.sh:\t detected=`expr \"$detected\" : \"fatal.*at line \\\\([0-9]*\\\\)\\$\"` &&\n  t/t4018-diff-funcname.sh:\t\t\tgrep \"fatal\" > /dev/null )\n  t/t4018-diff-funcname.sh:\tgrep \"fatal: Last expression must not be negated:\"\n  t/t5400-send-pack.sh:\tgrep \"warning: to refuse deleting\" child/errs &&\n  t/t5510-fetch.sh:\tgrep \"fatal: '\\''a\\\\\\\\!'\\''b'\\''\" result\n  t/t5516-fetch-push.sh:\tgrep \"warning: updating the current branch\" stderr\n  t/t5516-fetch-push.sh:\t! grep \"warning: updating the current branch\" stderr\n  t/t5516-fetch-push.sh:\t! grep \"warning: updating the current branch\" stderr\n  t/t6300-for-each-ref.sh:\t\t\\\"error: more than one quoting style\\\"*) : happy;;\n  t/test-lib.sh:\tsay_color error \"error: $*\"\n\nThat being said, I'm not sure we can change this at all since it's the\nplumbing way of reporting errors/warnings.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"105409","messageId":"20090219081725.GB7774@coredump.intra.peff.net","threadId":"17893","inReplyTo":"200902190736.49161.johnflux@gmail.com","subject":"Re: [PATCH 5/6] Change output \"error: \" to \"Error: \" etc","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-19T08:17:25Z","receivedAt":"2009-02-19T08:17:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 19, 2009 at 07:36:49AM +0000, John Tapsell wrote:\n\n> All the error messages starting \"Error: \" begin with a captial E, except\n> in one place.  This commit fixes this, making the output look more\n> consistent.  At the moment a failed push, say, looks like:\n> \n> Error: cannot lock existing info/refs\n> error: failed to push some refs to 'some repository'\n\nI think this commit message is a little misleading. True, there is only\none place where \"error:\" appears, but it is the place that is called by\nalmost every piece of code. So by far the majority of errors are \"error:\n\".\n\nhttp-push seems to be the odd man out. It contains one fprintf(stderr,\n\"Error: ...\") and one totally bogus error(\"Error: ...\"), which will\nprint \"error: Error: ...\". Perhaps it would be better to scan through\nthe code and switch to using error() and warning() as appropriate.\n\nThat will make things consistent, which addresses your complaint.  And\nthen there can be a discussion if people want about whether \"Error:\" or\n\"error:\" is better (personally I like lowercase).\n\n-Peff\n"},{"id":"105447","messageId":"20090219120708.GM4371@genesis.frugalware.org","threadId":"17893","inReplyTo":"20090219081725.GB7774@coredump.intra.peff.net","subject":"[PATCH] http-push: using error() and warning() as appropriate","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:07:08Z","receivedAt":"2009-02-19T12:07:08Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Change three occurrences of using inconsistent error/warning reporting\nby using the relevant error() / warning() calls to be consistent with\nthe rest of the code.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Thu, Feb 19, 2009 at 03:17:25AM -0500, Jeff King <peff@peff.net> wrote:\n> http-push seems to be the odd man out. It contains one fprintf(stderr,\n> \"Error: ...\") and one totally bogus error(\"Error: ...\"), which will\n> print \"error: Error: ...\". Perhaps it would be better to scan through\n> the code and switch to using error() and warning() as appropriate.\n\nI found these 3 occurrences.\n\n http-push.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 30d2d34..3a41d36 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -759,7 +759,7 @@ static void finish_request(struct transfer_request *request)\n \t\t\t}\n \t\t} else {\n \t\t\tif (request->http_code == 416)\n-\t\t\t\tfprintf(stderr, \"Warning: requested range invalid; we may already have all the data.\\n\");\n+\t\t\t\twarning(\"requested range invalid; we may already have all the data.\");\n \n \t\t\tgit_inflate_end(&request->stream);\n \t\t\tgit_SHA1_Final(request->real_sha1, &request->c);\n@@ -1616,7 +1616,7 @@ static int locking_available(void)\n \t\t\t}\n \t\t\tXML_ParserFree(parser);\n \t\t\tif (!lock_flags)\n-\t\t\t\terror(\"Error: no DAV locking support on %s\",\n+\t\t\t\terror(\"no DAV locking support on %s\",\n \t\t\t\t      remote->url);\n \n \t\t} else {\n@@ -2293,7 +2293,7 @@ int main(int argc, char **argv)\n \t\tif (info_ref_lock)\n \t\t\tremote->can_update_info_refs = 1;\n \t\telse {\n-\t\t\tfprintf(stderr, \"Error: cannot lock existing info/refs\\n\");\n+\t\t\terror(\"cannot lock existing info/refs\");\n \t\t\trc = 1;\n \t\t\tgoto cleanup;\n \t\t}\n-- \n1.6.1\n"},{"id":"105448","messageId":"20090219122104.GA4602@sigill.intra.peff.net","threadId":"17893","inReplyTo":"20090219120708.GM4371@genesis.frugalware.org","subject":"Re: [PATCH] http-push: using error() and warning() as appropriate","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-19T12:21:05Z","receivedAt":"2009-02-19T12:21:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 19, 2009 at 01:07:08PM +0100, Miklos Vajna wrote:\n\n> Change three occurrences of using inconsistent error/warning reporting\n> by using the relevant error() / warning() calls to be consistent with\n> the rest of the code.\n> \n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n> \n> On Thu, Feb 19, 2009 at 03:17:25AM -0500, Jeff King <peff@peff.net> wrote:\n> > http-push seems to be the odd man out. It contains one fprintf(stderr,\n> > \"Error: ...\") and one totally bogus error(\"Error: ...\"), which will\n> > print \"error: Error: ...\". Perhaps it would be better to scan through\n> > the code and switch to using error() and warning() as appropriate.\n> \n> I found these 3 occurrences.\n\nA few more are in the diff below. But there are even more:\n\n  - several \"Warning: \" lines in *.sh\n\n  - some warnings actually come with \"WARNING:\" on every line. I don't\n    think those should be changed, as they are obviously a more\n    strenuous warning.\n\n  - there are several places that manually print \"warning: \" via\n    fprintf. I suppose those can be cleaned up to use warning(), too.\n\n-Peff\n\n---\ndiff --git a/builtin-mv.c b/builtin-mv.c\nindex 01270fe..fc6bd82 100644\n--- a/builtin-mv.c\n+++ b/builtin-mv.c\n@@ -172,9 +172,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!\", 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-walker.c b/http-walker.c\nindex 0dbad3c..91abea7 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -235,7 +235,7 @@ static void finish_object_request(struct object_request *obj_req)\n \tclose(obj_req->local); obj_req->local = -1;\n \n \tif (obj_req->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 \t} else if (obj_req->curl_result != CURLE_OK) {\n \t\tif (stat(obj_req->tmpfile, &st) == 0)\n \t\t\tif (st.st_size == 0)\n"},{"id":"105450","messageId":"cover.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"20090219122104.GA4602@sigill.intra.peff.net","subject":"[PATCH 0/8] fprintf(stderr, \"warning: \") -> warning() patches","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:52:49Z","receivedAt":"2009-02-19T12:52:49Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Feb 19, 2009 at 07:21:05AM -0500, Jeff King <peff@peff.net> wrote:\n>   - there are several places that manually print \"warning: \" via\n>     fprintf. I suppose those can be cleaned up to use warning(), too.\n\nHere are 8 patches to do so. This does not contain the http-push patch I\nsend already in this thread, nor your patch.\n\nMiklos Vajna (8):\n  builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")\n  builtin-checkout: use warning() instead of fprintf(stderr, \"warning:\n    \")\n  builtin-fetch-pack: use warning() instead of fprintf(stderr,\n    \"warning: \")\n  builtin-init-db: use warning() instead of fprintf(stderr, \"warning:\n    \")\n  builtin-rm: use warning() instead of fprintf(stderr, \"warning: \")\n  builtin-show-branch: use warning() instead of fprintf(stderr,\n    \"warning: \")\n  builtin-show-ref: use warning() instead of fprintf(stderr, \"warning:\n    \")\n  refs: use warning() instead of fprintf(stderr, \"warning: \")\n\n builtin-apply.c       |   15 +++++++--------\n builtin-checkout.c    |    4 ++--\n builtin-fetch-pack.c  |    2 +-\n builtin-init-db.c     |    7 +++----\n builtin-rm.c          |    3 +--\n builtin-show-branch.c |    3 +--\n builtin-show-ref.c    |    2 +-\n refs.c                |    8 +++-----\n 8 files changed, 19 insertions(+), 25 deletions(-)\n"},{"id":"105451","messageId":"4f61642d10063adbff86094e91b1b6e90efabe8e.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:53:10Z","receivedAt":"2009-02-19T12:53:10Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n builtin-apply.c |   15 +++++++--------\n 1 files changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex f312798..f668825 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -2451,7 +2451,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s\n \tif ((st_mode ^ patch->old_mode) & S_IFMT)\n \t\treturn error(\"%s: wrong type\", old_name);\n \tif (st_mode != patch->old_mode)\n-\t\tfprintf(stderr, \"warning: %s has type %o, expected %o\\n\",\n+\t\twarning(\"%s has type %o, expected %o\",\n \t\t\told_name, st_mode, patch->old_mode);\n \tif (!patch->new_mode && !patch->is_delete)\n \t\tpatch->new_mode = st_mode;\n@@ -2932,8 +2932,7 @@ static int write_out_one_reject(struct patch *patch)\n \tcnt = strlen(patch->new_name);\n \tif (ARRAY_SIZE(namebuf) <= cnt + 5) {\n \t\tcnt = ARRAY_SIZE(namebuf) - 5;\n-\t\tfprintf(stderr,\n-\t\t\t\"warning: truncating .rej filename to %.*s.rej\",\n+\t\twarning(\"truncating .rej filename to %.*s.rej\",\n \t\t\tcnt - 1, patch->new_name);\n \t}\n \tmemcpy(namebuf, patch->new_name, cnt);\n@@ -3315,8 +3314,8 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)\n \t\t    squelch_whitespace_errors < whitespace_error) {\n \t\t\tint squelched =\n \t\t\t\twhitespace_error - squelch_whitespace_errors;\n-\t\t\tfprintf(stderr, \"warning: squelched %d \"\n-\t\t\t\t\"whitespace error%s\\n\",\n+\t\t\twarning(\"squelched %d \"\n+\t\t\t\t\"whitespace error%s\",\n \t\t\t\tsquelched,\n \t\t\t\tsquelched == 1 ? \"\" : \"s\");\n \t\t}\n@@ -3326,12 +3325,12 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)\n \t\t\t    whitespace_error == 1 ? \"\" : \"s\",\n \t\t\t    whitespace_error == 1 ? \"s\" : \"\");\n \t\tif (applied_after_fixing_ws && apply)\n-\t\t\tfprintf(stderr, \"warning: %d line%s applied after\"\n-\t\t\t\t\" fixing whitespace errors.\\n\",\n+\t\t\twarning(\"%d line%s applied after\"\n+\t\t\t\t\" fixing whitespace errors.\",\n \t\t\t\tapplied_after_fixing_ws,\n \t\t\t\tapplied_after_fixing_ws == 1 ? \"\" : \"s\");\n \t\telse if (whitespace_error)\n-\t\t\tfprintf(stderr, \"warning: %d line%s add%s whitespace errors.\\n\",\n+\t\t\twarning(\"%d line%s add%s whitespace errors.\",\n \t\t\t\twhitespace_error,\n \t\t\t\twhitespace_error == 1 ? \"\" : \"s\",\n \t\t\t\twhitespace_error == 1 ? \"s\" : \"\");\n-- \n1.6.1\n"},{"id":"105452","messageId":"85cc0cd257f02379985aca3cb20263a8f3c61486.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 2/8] builtin-checkout: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:53:28Z","receivedAt":"2009-02-19T12:53:28Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n builtin-checkout.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-checkout.c b/builtin-checkout.c\nindex 20b34ce..0ddd34b 100644\n--- a/builtin-checkout.c\n+++ b/builtin-checkout.c\n@@ -556,8 +556,8 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)\n \n \tif (!old.commit && !opts->force) {\n \t\tif (!opts->quiet) {\n-\t\t\tfprintf(stderr, \"warning: You appear to be on a branch yet to be born.\\n\");\n-\t\t\tfprintf(stderr, \"warning: Forcing checkout of %s.\\n\", new->name);\n+\t\t\twarning(\"You appear to be on a branch yet to be born.\");\n+\t\t\twarning(\"Forcing checkout of %s.\", new->name);\n \t\t}\n \t\topts->force = 1;\n \t}\n-- \n1.6.1\n"},{"id":"105453","messageId":"842406ced89cabde4bd59150834ce08d88afb461.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 3/8] builtin-fetch-pack: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:53:47Z","receivedAt":"2009-02-19T12:53:47Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"---\n builtin-fetch-pack.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 67fb80e..85de2ba 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -606,7 +606,7 @@ static struct ref *do_fetch_pack(int fd[2],\n \t\t\t/* When cloning, it is not unusual to have\n \t\t\t * no common commit.\n \t\t\t */\n-\t\t\tfprintf(stderr, \"warning: no common commits\\n\");\n+\t\t\twarning(\"no common commits\");\n \n \tif (get_pack(fd, pack_lockfile))\n \t\tdie(\"git fetch-pack: fetch failed.\");\n-- \n1.6.1\n"},{"id":"105454","messageId":"70fd98a12f76097ba152bc3f1bc929a3b19ec8dd.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 4/8] builtin-init-db: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:54:11Z","receivedAt":"2009-02-19T12:54:11Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"---\n builtin-init-db.c |    7 +++----\n 1 files changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-init-db.c b/builtin-init-db.c\nindex ee3911f..fc63d0f 100644\n--- a/builtin-init-db.c\n+++ b/builtin-init-db.c\n@@ -130,8 +130,7 @@ static void copy_templates(const char *template_dir)\n \t}\n \tdir = opendir(template_path);\n \tif (!dir) {\n-\t\tfprintf(stderr, \"warning: templates not found %s\\n\",\n-\t\t\ttemplate_dir);\n+\t\twarning(\"templates not found %s\", template_dir);\n \t\treturn;\n \t}\n \n@@ -144,8 +143,8 @@ static void copy_templates(const char *template_dir)\n \n \tif (repository_format_version &&\n \t    repository_format_version != GIT_REPO_VERSION) {\n-\t\tfprintf(stderr, \"warning: not copying templates of \"\n-\t\t\t\"a wrong format version %d from '%s'\\n\",\n+\t\twarning(\"not copying templates of \"\n+\t\t\t\"a wrong format version %d from '%s'\",\n \t\t\trepository_format_version,\n \t\t\ttemplate_dir);\n \t\tclosedir(dir);\n-- \n1.6.1\n"},{"id":"105455","messageId":"dde5b527fe5d5dc668ce65c46713a3abdd33ea20.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 5/8] builtin-rm: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:54:31Z","receivedAt":"2009-02-19T12:54:31Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n builtin-rm.c |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-rm.c b/builtin-rm.c\nindex c11f455..269d608 100644\n--- a/builtin-rm.c\n+++ b/builtin-rm.c\n@@ -59,8 +59,7 @@ static int check_local_mod(unsigned char *head, int index_only)\n \n \t\tif (lstat(ce->name, &st) < 0) {\n \t\t\tif (errno != ENOENT)\n-\t\t\t\tfprintf(stderr, \"warning: '%s': %s\",\n-\t\t\t\t\tce->name, strerror(errno));\n+\t\t\t\twarning(\"'%s': %s\", ce->name, strerror(errno));\n \t\t\t/* It already vanished from the working tree */\n \t\t\tcontinue;\n \t\t}\n-- \n1.6.1\n"},{"id":"105456","messageId":"8095a2134bdbd7edbdeee730ae06d785401c9540.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 6/8] builtin-show-branch: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:54:48Z","receivedAt":"2009-02-19T12:54:48Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n builtin-show-branch.c |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 306b850..828e6f8 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -365,8 +365,7 @@ static int append_ref(const char *refname, const unsigned char *sha1,\n \t\t\t\treturn 0;\n \t}\n \tif (MAX_REVS <= ref_name_cnt) {\n-\t\tfprintf(stderr, \"warning: ignoring %s; \"\n-\t\t\t\"cannot handle more than %d refs\\n\",\n+\t\twarning(\"ignoring %s; cannot handle more than %d refs\",\n \t\t\trefname, MAX_REVS);\n \t\treturn 0;\n \t}\n-- \n1.6.1\n"},{"id":"105457","messageId":"3fb08b8fb972b27d2a75f6cf24de757dd7dcd7a6.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 7/8] builtin-show-ref: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:55:22Z","receivedAt":"2009-02-19T12:55:22Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n builtin-show-ref.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-show-ref.c b/builtin-show-ref.c\nindex 572b114..dc76c50 100644\n--- a/builtin-show-ref.c\n+++ b/builtin-show-ref.c\n@@ -140,7 +140,7 @@ static int exclude_existing(const char *match)\n \t\t\t\tcontinue;\n \t\t}\n \t\tif (check_ref_format(ref)) {\n-\t\t\tfprintf(stderr, \"warning: ref '%s' ignored\\n\", ref);\n+\t\t\twarning(\"ref '%s' ignored\", ref);\n \t\t\tcontinue;\n \t\t}\n \t\tif (!string_list_has_string(&existing_refs, ref)) {\n-- \n1.6.1\n"},{"id":"105458","messageId":"628e1950be4069a614567fd4fc06aa2ce95a1004.1235047192.git.vmiklos@frugalware.org","threadId":"17893","inReplyTo":"cover.1235047192.git.vmiklos@frugalware.org","subject":"[PATCH 8/8] refs: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-19T12:55:44Z","receivedAt":"2009-02-19T12:55:44Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n refs.c |    8 +++-----\n 1 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 6eb5f53..fd96824 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -995,7 +995,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)\n \n \terr = unlink(git_path(\"logs/%s\", lock->ref_name));\n \tif (err && errno != ENOENT)\n-\t\tfprintf(stderr, \"warning: unlink(%s) failed: %s\",\n+\t\twarning(\"unlink(%s) failed: %s\",\n \t\t\tgit_path(\"logs/%s\", lock->ref_name), strerror(errno));\n \tinvalidate_cached_refs();\n \tunlock_ref(lock);\n@@ -1437,8 +1437,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *\n \t\t\t\tif (get_sha1_hex(rec + 41, sha1))\n \t\t\t\t\tdie(\"Log %s is corrupt.\", logfile);\n \t\t\t\tif (hashcmp(logged_sha1, sha1)) {\n-\t\t\t\t\tfprintf(stderr,\n-\t\t\t\t\t\t\"warning: Log %s has gap after %s.\\n\",\n+\t\t\t\t\twarning(\"Log %s has gap after %s.\",\n \t\t\t\t\t\tlogfile, show_date(date, tz, DATE_RFC2822));\n \t\t\t\t}\n \t\t\t}\n@@ -1450,8 +1449,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *\n \t\t\t\tif (get_sha1_hex(rec + 41, logged_sha1))\n \t\t\t\t\tdie(\"Log %s is corrupt.\", logfile);\n \t\t\t\tif (hashcmp(logged_sha1, sha1)) {\n-\t\t\t\t\tfprintf(stderr,\n-\t\t\t\t\t\t\"warning: Log %s unexpectedly ended on %s.\\n\",\n+\t\t\t\t\twarning(\"Log %s unexpectedly ended on %s.\",\n \t\t\t\t\t\tlogfile, show_date(date, tz, DATE_RFC2822));\n \t\t\t\t}\n \t\t\t}\n-- \n1.6.1\n"},{"id":"105547","messageId":"20090220030245.GC22419@coredump.intra.peff.net","threadId":"17893","inReplyTo":"4f61642d10063adbff86094e91b1b6e90efabe8e.1235047192.git.vmiklos@frugalware.org","subject":"Re: [PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-02-20T03:02:45Z","receivedAt":"2009-02-20T03:02:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 19, 2009 at 01:53:10PM +0100, Miklos Vajna wrote:\n\n> @@ -2932,8 +2932,7 @@ static int write_out_one_reject(struct patch *patch)\n>  \tcnt = strlen(patch->new_name);\n>  \tif (ARRAY_SIZE(namebuf) <= cnt + 5) {\n>  \t\tcnt = ARRAY_SIZE(namebuf) - 5;\n> -\t\tfprintf(stderr,\n> -\t\t\t\"warning: truncating .rej filename to %.*s.rej\",\n> +\t\twarning(\"truncating .rej filename to %.*s.rej\",\n>  \t\t\tcnt - 1, patch->new_name);\n>  \t}\n\nHmm. This hunk is actually changing behavior, as the original didn't\nhave a newline. It looks like a bug in the original, though.\n\nOther than that, these all look pretty straightforward. Probably the\nshell scripts should be switched to match, too. But it would be nice to\nhear from Junio first that this cleanup is even desired (so you don't\nwaste time).\n\n-Peff\n"},{"id":"105565","messageId":"7viqn5iqnn.fsf@gitster.siamese.dyndns.org","threadId":"17893","inReplyTo":"20090220030245.GC22419@coredump.intra.peff.net","subject":"Re: [PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-20T06:11:24Z","receivedAt":"2009-02-20T06:11:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Other than that, these all look pretty straightforward. Probably the\n> shell scripts should be switched to match, too. But it would be nice to\n> hear from Junio first that this cleanup is even desired (so you don't\n> waste time).\n\nI think it is a good thing to do.  If the pre-release-freeze is a good\ntime to do so it is a different matter.  A good way to judge would be \nhow much of these overlap with \"git diff master next\" (smaller the better,\nobviously).\n"},{"id":"105594","messageId":"20090220094103.GY4371@genesis.frugalware.org","threadId":"17893","inReplyTo":"20090220030245.GC22419@coredump.intra.peff.net","subject":"Re: [PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-02-20T09:41:03Z","receivedAt":"2009-02-20T09:41:03Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Feb 19, 2009 at 10:02:45PM -0500, Jeff King <peff@peff.net> wrote:\n> On Thu, Feb 19, 2009 at 01:53:10PM +0100, Miklos Vajna wrote:\n> \n> > @@ -2932,8 +2932,7 @@ static int write_out_one_reject(struct patch *patch)\n> >  \tcnt = strlen(patch->new_name);\n> >  \tif (ARRAY_SIZE(namebuf) <= cnt + 5) {\n> >  \t\tcnt = ARRAY_SIZE(namebuf) - 5;\n> > -\t\tfprintf(stderr,\n> > -\t\t\t\"warning: truncating .rej filename to %.*s.rej\",\n> > +\t\twarning(\"truncating .rej filename to %.*s.rej\",\n> >  \t\t\tcnt - 1, patch->new_name);\n> >  \t}\n> \n> Hmm. This hunk is actually changing behavior, as the original didn't\n> have a newline. It looks like a bug in the original, though.\n\nI think so. The change in 5/8 (git-rm) is a similar one.\n"},{"id":"108891","messageId":"20090322113646.GL27459@genesis.frugalware.org","threadId":"17893","inReplyTo":"7viqn5iqnn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-03-22T11:36:46Z","receivedAt":"2009-03-22T11:36:46Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Feb 19, 2009 at 10:11:24PM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> Jeff King <peff@peff.net> writes:\n> \n> > Other than that, these all look pretty straightforward. Probably the\n> > shell scripts should be switched to match, too. But it would be nice to\n> > hear from Junio first that this cleanup is even desired (so you don't\n> > waste time).\n> \n> I think it is a good thing to do.  If the pre-release-freeze is a good\n> time to do so it is a different matter.  A good way to judge would be \n> how much of these overlap with \"git diff master next\" (smaller the better,\n> obviously).\n\nShould I rebase the series against current master and resend?\n"},{"id":"108936","messageId":"7v3ad5dxt5.fsf@gitster.siamese.dyndns.org","threadId":"17893","inReplyTo":"20090322113646.GL27459@genesis.frugalware.org","subject":"Re: [PATCH 1/8] builtin-apply: use warning() instead of fprintf(stderr, \"warning: \")","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-22T21:58:46Z","receivedAt":"2009-03-22T21:58:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> On Thu, Feb 19, 2009 at 10:11:24PM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n>> Jeff King <peff@peff.net> writes:\n>> \n>> > Other than that, these all look pretty straightforward. Probably the\n>> > shell scripts should be switched to match, too. But it would be nice to\n>> > hear from Junio first that this cleanup is even desired (so you don't\n>> > waste time).\n>> \n>> I think it is a good thing to do.  If the pre-release-freeze is a good\n>> time to do so it is a different matter.  A good way to judge would be \n>> how much of these overlap with \"git diff master next\" (smaller the better,\n>> obviously).\n>\n> Should I rebase the series against current master and resend?\n\nYes, please, if the overlap with \"diff master next\" is small enough.\n"}]}