{"thread":{"id":"14063","subject":"[PATCH] Added the printing of 'errno' error number when the attempt to open the COMMIT_EDITMSG file is failed","startedAt":"2008-06-20T15:55:54Z","lastAt":"2008-06-20T15:55:54Z","messageCount":1,"participants":["Cristian Peraferrer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"80497","messageId":"1D8D9EA1-720A-446D-BA32-E83E88155E0A@gmail.com","threadId":"14063","inReplyTo":null,"subject":"[PATCH] Added the printing of 'errno' error number when the attempt to open the COMMIT_EDITMSG file is failed","fromName":"Cristian Peraferrer","fromEmail":"corellian.c@gmail.com","sentAt":"2008-06-20T15:55:54Z","receivedAt":"2008-06-20T15:55:54Z","isPatch":true,"sender":{"key":"corellian.c@gmail.com","avatar":"https://gravatar.com/avatar/2784fca61a754ae4ee27f05f2298cae037b282dd31e434f1b95c24a3969e913c?d=mp&s=160"},"body":"From: Cristian Peraferrer <corellian.c@gmail.com>\nDate: Fri, 20 Jun 2008 17:24:20 +0200\nSubject: [PATCH] Added the printing of 'errno' error number when the  \nattempt to open the COMMIT_EDITMSG file is failed\n\nNow when the COMMIT_EDITMSG cannot be opened, the die message gives\nmore information to the user by giving the 'errno' number.\n\nSigned-off-by: Cristian Peraferrer <corellian.c@gmail.com>\n---\n  builtin-commit.c |    3 ++-\n  1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 90200ed..a33f43a 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -502,7 +502,8 @@ static int prepare_to_commit(const char  \n*index_file, const char *prefix)\n\n  \tfp = fopen(git_path(commit_editmsg), \"w\");\n  \tif (fp == NULL)\n-\t\tdie(\"could not open %s\", git_path(commit_editmsg));\n+\t\tdie(\"could not open %s: %s\",\n+\t\t    git_path(commit_editmsg), strerror(errno));\n\n  \tif (cleanup_mode != CLEANUP_NONE)\n  \t\tstripspace(&sb, 0);\n-- \n1.5.5\n"}]}