Re: [PATCH 2/2] merge: warn --no-commit merge when no new commit is created
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Apr 27, 2016, 05:57 UTC
- Message-ID
- <572054B9.5080601@kdbg.org>
- In-Reply-To
- <xmqqd1pcdpb8.fsf_-_@gitster.mtv.corp.google.com>
Am 26.04.2016 um 23:37 schrieb Junio C Hamano:
> * The necessary update to avoid end-user mistake would look like > this. I am not queuing this or further working on it myself, > as I am not sure if it is all that useful.
Whoever picks up this patch, be warned that the i18n coding should be corrected:
> +static void no_commit_impossible(const char *message)
> +{
> + if (!option_commit) {
> + warning("%s\n%s", _(message),The i18n call around message is not required, because...
Show 13 quoted lines
> + _("--no-commit is impossible"));
> + warning(_("In future versions of Git, this will become an error."));
> + }
> +}
> +
> 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"));... the call sites takes care of it.
-- Hannes