From: Felipe Contreras Date: Wed, 07 Jul 2021 17:42:58 GMT Subject: RE: [PATCH v2 2/2] commit: remove irrelavent prompt on `--allow-empty-message` Message-ID: <60e5e7a2d2ddf_30143720855@natae.notmuch> In-Reply-To: <20210707162308.2438170-3-hujialun@comp.nus.edu.sg> Hu Jialun wrote: > --- a/builtin/commit.c > +++ b/builtin/commit.c > @@ -918,7 +918,9 @@ static int prepare_to_commit(const char *index_file, const char *prefix, > if (cleanup_mode == COMMIT_MSG_CLEANUP_ALL) { > status_printf_ln(s, GIT_COLOR_NORMAL, msg_enter_prompt); > status_printf_ln(s, GIT_COLOR_NORMAL, ignore_char_prompt, comment_line_char); > - status_printf_ln(s, GIT_COLOR_NORMAL, empty_msg_abort_prompt); > + if (!allow_empty_message) { > + status_printf_ln(s, GIT_COLOR_NORMAL, empty_msg_abort_prompt); > + } In git the style is to avoid braces if the content of the condition is a single line. -- Felipe Contreras