Re: [PATCH 5/5] commit, status: use status_printf{,_ln,_more} helpers
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 27, 2011, 09:11 UTC
- Message-ID
- <7vaahh6dw0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110226051137.GE27887@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 16 quoted lines
> diff --git a/builtin/commit.c b/builtin/commit.c
> index ef5f0b2..ae62a25 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -694,50 +694,51 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
> if (use_editor && include_status) {
> char *ai_tmp, *ci_tmp;
> if (in_merge)
> -...
> + status_printf_ln(s, GIT_COLOR_NORMAL,
> + "\n"
> + "It looks like you may be committing a MERGE.\n"
> + "If this is not correct, please remove the file\n"
> + " %s\n"
> + "and try again.\n"
> + "",This trick to avoid difference-in-comma-when-updated was semi "Huh" when reading. Is it worth it?
> ... > if (ident_shown) > - fprintf(s->fp, "#\n"); > + status_printf_ln(s, GIT_COLOR_NORMAL, "");
The "attribute((format))" safety seems to bite us here...
$ Meta/Make --pedantic builtin/commit.o
CC builtin/commit.o
cc1: warnings being treated as errors
builtin/commit.c: In function 'prepare_to_commit':
builtin/commit.c:741: error: zero-length printf format stringIn wt-status.c many similar ones exist, unfortunately.