Re: [PATCH v1 1/8] commit: move empty message checks to libgit
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 7, 2017, 00:43 UTC
- Message-ID
- <alpine.DEB.2.21.1.1711070141110.6482@virtualbox>
- In-Reply-To
- <20171106112709.2121-2-phillip.wood@talktalk.net>
Hi Phillip,
On Mon, 6 Nov 2017, Phillip Wood wrote:
Show 8 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk> > > Move the functions that check for empty messages from bulitin/commit.c > to sequencer.c so they can be shared with other commands. The > functions are refactored to take an explicit cleanup mode and template > filename passed by the caller. > > Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Good rationale. Just one thing:
Show 14 quoted lines
> diff --git a/sequencer.h b/sequencer.h
> index 6f3d3df82c0ade64b7b125acd49bf3f5e15c53af..65a4b0c25185d7ad5115035abb766d1b95df9a62 100644
> --- a/sequencer.h
> +++ b/sequencer.h
> @@ -58,4 +58,14 @@ extern const char sign_off_header[];
> void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);
> void append_conflicts_hint(struct strbuf *msgbuf);
>
> +enum cleanup_mode {
> + CLEANUP_SPACE,
> + CLEANUP_NONE,
> + CLEANUP_SCISSORS,
> + CLEANUP_ALL
> +};When it was file-local, `cleanup_mode` was okay (although far from great). Now that we want to make it more widely available, I fear we have to make the name much longer, e.g. `commit_msg_cleanup_mode`.
Ciao, Dscho