git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] builtin/add: add detail to a 'cannot chmod' error message
@ 2017-08-09  0:51 Ramsay Jones
  2017-08-09  5:45 ` Junio C Hamano
  2017-08-09  6:54 ` Jonathan Nieder
  0 siblings, 2 replies; 3+ messages in thread
From: Ramsay Jones @ 2017-08-09  0:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: René Scharfe, Jonathan Nieder, GIT Mailing-list


In addition to adding the missing newline, add the x-ecutable bit
'mode change' character to the error message. This message now has
the same form as similar messages output by 'update-index'.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Junio,

This is v2 of the earlier "add a newline" patch. Thanks!

ATB,
Ramsay Jones

 builtin/add.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/add.c b/builtin/add.c
index e888fb8c5..5d5773d5c 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -32,7 +32,7 @@ struct update_callback_data {
 	int add_errors;
 };
 
-static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
+static void chmod_pathspec(struct pathspec *pathspec, char flip)
 {
 	int i;
 
@@ -42,8 +42,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
 		if (pathspec && !ce_path_match(ce, pathspec, NULL))
 			continue;
 
-		if (chmod_cache_entry(ce, force_mode) < 0)
-			fprintf(stderr, "cannot chmod '%s'", ce->name);
+		if (chmod_cache_entry(ce, flip) < 0)
+			fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
 	}
 }
 
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] builtin/add: add detail to a 'cannot chmod' error message
  2017-08-09  0:51 [PATCH] builtin/add: add detail to a 'cannot chmod' error message Ramsay Jones
@ 2017-08-09  5:45 ` Junio C Hamano
  2017-08-09  6:54 ` Jonathan Nieder
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2017-08-09  5:45 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: René Scharfe, Jonathan Nieder, GIT Mailing-list

Ramsay Jones <ramsay@ramsayjones.plus.com> writes:

> In addition to adding the missing newline, add the x-ecutable bit
> 'mode change' character to the error message. This message now has
> the same form as similar messages output by 'update-index'.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Junio,
>
> This is v2 of the earlier "add a newline" patch. Thanks!

Thanks; here is me reminding myself to apply this with Jonathan's
reviewed-by in the morning.

>
> ATB,
> Ramsay Jones
>
>  builtin/add.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/builtin/add.c b/builtin/add.c
> index e888fb8c5..5d5773d5c 100644
> --- a/builtin/add.c
> +++ b/builtin/add.c
> @@ -32,7 +32,7 @@ struct update_callback_data {
>  	int add_errors;
>  };
>  
> -static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
> +static void chmod_pathspec(struct pathspec *pathspec, char flip)
>  {
>  	int i;
>  
> @@ -42,8 +42,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
>  		if (pathspec && !ce_path_match(ce, pathspec, NULL))
>  			continue;
>  
> -		if (chmod_cache_entry(ce, force_mode) < 0)
> -			fprintf(stderr, "cannot chmod '%s'", ce->name);
> +		if (chmod_cache_entry(ce, flip) < 0)
> +			fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
>  	}
>  }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] builtin/add: add detail to a 'cannot chmod' error message
  2017-08-09  0:51 [PATCH] builtin/add: add detail to a 'cannot chmod' error message Ramsay Jones
  2017-08-09  5:45 ` Junio C Hamano
@ 2017-08-09  6:54 ` Jonathan Nieder
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Nieder @ 2017-08-09  6:54 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, René Scharfe, GIT Mailing-list

Ramsay Jones wrote:

> In addition to adding the missing newline, add the x-ecutable bit
> 'mode change' character to the error message. This message now has
> the same form as similar messages output by 'update-index'.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> This is v2 of the earlier "add a newline" patch. Thanks!
>
>  builtin/add.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-09  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09  0:51 [PATCH] builtin/add: add detail to a 'cannot chmod' error message Ramsay Jones
2017-08-09  5:45 ` Junio C Hamano
2017-08-09  6:54 ` Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).