On Thu, Jul 06, 2017 at 09:01:49AM +0530, Kaartic Sivaraam wrote: > In the context of "git merge" the meaning of an "empty message" > is one that contains no line of text. This is not in line with > "git commit" where an "empty message" is one that contains only > whitespaces and/or signed-off-by lines. This could cause surprises > to users who are accustomed to the meaning of an "empty message" > of "git commit". > > Prevent such surprises by changing the meaning of an empty 'merge > message' to be in line with that of an empty 'commit message'. > > Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@xxxxxxxxx> > --- > builtin/merge.c | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > > diff --git a/builtin/merge.c b/builtin/merge.c > index 703827f00..db4bf1c40 100644 > --- a/builtin/merge.c > +++ b/builtin/merge.c > @@ -748,6 +748,39 @@ static void abort_commit(struct commit_list *remoteheads, const char *err_msg) > exit(1); > } > > +/* > + * Find out if the message in the strbuf contains only whitespace and > + * Signed-off-by lines. > + * > + * This function is the "rest_is_space" function of "commit" with the unwanted > + * parameter removed. The function is called "rest_is_empty". But isn't it better that commit and merge use the same code, instead of duplicating it again? Otherwise one may be updated, and the other forgotten, getting differences in behaviur, which is what you want to solve. Kevin