{"thread":{"id":"46546","subject":"[PATCH] builtin/add: add detail to a 'cannot chmod' error message","startedAt":"2017-08-09T00:51:31Z","lastAt":"2017-08-09T06:54:59Z","messageCount":3,"participants":["Ramsay Jones","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"325888","messageId":"aa004526-3e0d-66d4-287f-30abd29758fc@ramsayjones.plus.com","threadId":"46546","inReplyTo":null,"subject":"[PATCH] builtin/add: add detail to a 'cannot chmod' error message","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2017-08-09T00:51:23Z","receivedAt":"2017-08-09T00:51:31Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn addition to adding the missing newline, add the x-ecutable bit\n'mode change' character to the error message. This message now has\nthe same form as similar messages output by 'update-index'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Junio,\n\nThis is v2 of the earlier \"add a newline\" patch. Thanks!\n\nATB,\nRamsay Jones\n\n builtin/add.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex e888fb8c5..5d5773d5c 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -32,7 +32,7 @@ struct update_callback_data {\n \tint add_errors;\n };\n \n-static void chmod_pathspec(struct pathspec *pathspec, int force_mode)\n+static void chmod_pathspec(struct pathspec *pathspec, char flip)\n {\n \tint i;\n \n@@ -42,8 +42,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)\n \t\tif (pathspec && !ce_path_match(ce, pathspec, NULL))\n \t\t\tcontinue;\n \n-\t\tif (chmod_cache_entry(ce, force_mode) < 0)\n-\t\t\tfprintf(stderr, \"cannot chmod '%s'\", ce->name);\n+\t\tif (chmod_cache_entry(ce, flip) < 0)\n+\t\t\tfprintf(stderr, \"cannot chmod %cx '%s'\\n\", flip, ce->name);\n \t}\n }\n \n-- \n2.14.0\n"},{"id":"325919","messageId":"xmqqd1858fb7.fsf@gitster.mtv.corp.google.com","threadId":"46546","inReplyTo":"aa004526-3e0d-66d4-287f-30abd29758fc@ramsayjones.plus.com","subject":"Re: [PATCH] builtin/add: add detail to a 'cannot chmod' error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-08-09T05:45:32Z","receivedAt":"2017-08-09T05:45:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> In addition to adding the missing newline, add the x-ecutable bit\n> 'mode change' character to the error message. This message now has\n> the same form as similar messages output by 'update-index'.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>\n> Hi Junio,\n>\n> This is v2 of the earlier \"add a newline\" patch. Thanks!\n\nThanks; here is me reminding myself to apply this with Jonathan's\nreviewed-by in the morning.\n\n>\n> ATB,\n> Ramsay Jones\n>\n>  builtin/add.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/builtin/add.c b/builtin/add.c\n> index e888fb8c5..5d5773d5c 100644\n> --- a/builtin/add.c\n> +++ b/builtin/add.c\n> @@ -32,7 +32,7 @@ struct update_callback_data {\n>  \tint add_errors;\n>  };\n>  \n> -static void chmod_pathspec(struct pathspec *pathspec, int force_mode)\n> +static void chmod_pathspec(struct pathspec *pathspec, char flip)\n>  {\n>  \tint i;\n>  \n> @@ -42,8 +42,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)\n>  \t\tif (pathspec && !ce_path_match(ce, pathspec, NULL))\n>  \t\t\tcontinue;\n>  \n> -\t\tif (chmod_cache_entry(ce, force_mode) < 0)\n> -\t\t\tfprintf(stderr, \"cannot chmod '%s'\", ce->name);\n> +\t\tif (chmod_cache_entry(ce, flip) < 0)\n> +\t\t\tfprintf(stderr, \"cannot chmod %cx '%s'\\n\", flip, ce->name);\n>  \t}\n>  }\n"},{"id":"325922","messageId":"20170809065435.GA29220@aiede.mtv.corp.google.com","threadId":"46546","inReplyTo":"aa004526-3e0d-66d4-287f-30abd29758fc@ramsayjones.plus.com","subject":"Re: [PATCH] builtin/add: add detail to a 'cannot chmod' error message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-08-09T06:54:35Z","receivedAt":"2017-08-09T06:54:59Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ramsay Jones wrote:\n\n> In addition to adding the missing newline, add the x-ecutable bit\n> 'mode change' character to the error message. This message now has\n> the same form as similar messages output by 'update-index'.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> This is v2 of the earlier \"add a newline\" patch. Thanks!\n>\n>  builtin/add.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"}]}