{"thread":{"id":"36017","subject":"[PATCH v2] Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.","startedAt":"2014-03-02T02:43:39Z","lastAt":"2014-03-02T07:18:38Z","messageCount":3,"participants":["Sun He","Eric Sunshine","He Sun"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"235770","messageId":"1393728219-3142-1-git-send-email-sunheehnus@gmail.com","threadId":"36017","inReplyTo":null,"subject":"[PATCH v2] Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.","fromName":"Sun He","fromEmail":"sunheehnus@gmail.com","sentAt":"2014-03-02T02:43:39Z","receivedAt":"2014-03-02T02:43:39Z","isPatch":true,"sender":{"key":"sunheehnus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2889804?v=4"},"body":"Signed-off-by: Sun He <sunheehnus@gmail.com>\n---\n\n As tmpname is used without initialization, it should be a mistake.\n\n builtin/pack-objects.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex c733379..4922ce5 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -823,7 +823,7 @@ static void write_pack_file(void)\n \t\t\t\tutb.modtime = --last_mtime;\n \t\t\t\tif (utime(pack_tmp_name, &utb) < 0)\n \t\t\t\t\twarning(\"failed utime() on %s: %s\",\n-\t\t\t\t\t\ttmpname, strerror(errno));\n+\t\t\t\t\t\tpack_tmp_name, strerror(errno));\n \t\t\t}\n \n \t\t\t/* Enough space for \"-<sha-1>.pack\"? */\n-- \n1.9.0.138.g2de3478.dirty\n"},{"id":"235779","messageId":"CAPig+cQS53vzZQrkeZDX7ci4708o9bVp5QMvNnesZU17u1Fz2w@mail.gmail.com","threadId":"36017","inReplyTo":"1393728219-3142-1-git-send-email-sunheehnus@gmail.com","subject":"Re: [PATCH v2] Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-03-02T03:59:56Z","receivedAt":"2014-03-02T03:59:56Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Mar 1, 2014 at 9:43 PM, Sun He <sunheehnus@gmail.com> wrote:\n> Subject: Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.\n\nThe subject should be a short summary of the change, and the rest of\nthe commit message before the \"---\" line provides extra detail\nexplaining the change.\n\n> Signed-off-by: Sun He <sunheehnus@gmail.com>\n> ---\n>\n>  As tmpname is used without initialization, it should be a mistake.\n\nThis is valid information for the commit message above the \"---\" line.\nSo, your full commit message might say something like this:\n\n    Subject: write_pack_file: use correct variable in diagnostic\n\n    'pack_tmp_name' is the subject of the utime() check, so report\n    it in the warning, not the uninitialized 'tmpname'.\n\n>  builtin/pack-objects.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\n> index c733379..4922ce5 100644\n> --- a/builtin/pack-objects.c\n> +++ b/builtin/pack-objects.c\n> @@ -823,7 +823,7 @@ static void write_pack_file(void)\n>                                 utb.modtime = --last_mtime;\n>                                 if (utime(pack_tmp_name, &utb) < 0)\n>                                         warning(\"failed utime() on %s: %s\",\n> -                                               tmpname, strerror(errno));\n> +                                               pack_tmp_name, strerror(errno));\n>                         }\n>\n>                         /* Enough space for \"-<sha-1>.pack\"? */\n> --\n> 1.9.0.138.g2de3478.dirty\n"},{"id":"235784","messageId":"CAJr59C0vf7F9eXgJVmFfC4gbHDHFvx14Z1ywz8YeLMSWLgVRkA@mail.gmail.com","threadId":"36017","inReplyTo":"CAPig+cQS53vzZQrkeZDX7ci4708o9bVp5QMvNnesZU17u1Fz2w@mail.gmail.com","subject":"Re: [PATCH v2] Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.","fromName":"He Sun","fromEmail":"sunheehnus@gmail.com","sentAt":"2014-03-02T07:18:38Z","receivedAt":"2014-03-02T07:18:38Z","isPatch":true,"sender":{"key":"sunheehnus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2889804?v=4"},"body":"2014-03-02 11:59 GMT+08:00 Eric Sunshine <sunshine@sunshineco.com>:\n> On Sat, Mar 1, 2014 at 9:43 PM, Sun He <sunheehnus@gmail.com> wrote:\n>> Subject: Replace tmpname with pack_tmp_name in warning. The developer mistook tmpname for pack_tmp_name.\n>\n> The subject should be a short summary of the change, and the rest of\n> the commit message before the \"---\" line provides extra detail\n> explaining the change.\n>\n\nOK, got it.\nThank you very much.\n\n>> Signed-off-by: Sun He <sunheehnus@gmail.com>\n>> ---\n>>\n>>  As tmpname is used without initialization, it should be a mistake.\n>\n> This is valid information for the commit message above the \"---\" line.\n> So, your full commit message might say something like this:\n>\n>     Subject: write_pack_file: use correct variable in diagnostic\n>\n>     'pack_tmp_name' is the subject of the utime() check, so report\n>     it in the warning, not the uninitialized 'tmpname'.\n>\n\nThank you for your suggestion, I will modify it right now. :-)\n\n>>  builtin/pack-objects.c | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\n>> index c733379..4922ce5 100644\n>> --- a/builtin/pack-objects.c\n>> +++ b/builtin/pack-objects.c\n>> @@ -823,7 +823,7 @@ static void write_pack_file(void)\n>>                                 utb.modtime = --last_mtime;\n>>                                 if (utime(pack_tmp_name, &utb) < 0)\n>>                                         warning(\"failed utime() on %s: %s\",\n>> -                                               tmpname, strerror(errno));\n>> +                                               pack_tmp_name, strerror(errno));\n>>                         }\n>>\n>>                         /* Enough space for \"-<sha-1>.pack\"? */\n>> --\n>> 1.9.0.138.g2de3478.dirty\n"}]}