Re: [PATCH 2/2] merge: warn --no-commit merge when no new commit is created
From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:01
Stefan Beller [off-list ref] writes:
and later
if (!option_commit)
no_commit_impossible(_("Already up-to-date"));It would be more legible, but because there are so few callsites in an already shallow callchain, I do not think it makes that much of a difference in this codepath either way.
quoted
+ int cmd_merge(int argc, const char **argv, const char *prefix) { unsigned char result_tree[20];@@ -1403,6 +1412,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) * If head can reach all the merge then we are up to date. * but first the most common case of merging one remote. */ + no_commit_impossible(_("Already up-to-date")); finish_up_to_date("Already up-to-date.");Coming back to this patch, in case of -v given, we'll see ("Already up-to-date") twice?
One that explains why --no-commit is impossible in warning, and the other is the final report of what happened, so yes.
If --quiet is given, do we want to suppress output in no_commit_impossible?
While we are using warning(), we probably do want to. When we switch to die() at a major version boundary, we don't.