Re: [PATCH 1/5 v2] merge-recursive: porcelain messages for checkout
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:48:58
Diane Gasselin [off-list ref] writes:
quoted hunk
--- a/builtin/checkout.c +++ b/builtin/checkout.c@@ -372,6 +372,7 @@ static int merge_working_tree(struct checkout_opts *opts, topts.src_index = &the_index; topts.dst_index = &the_index; + topts.msgs = get_porcelain_error_msgs("checkout"); topts.msgs.not_uptodate_file = "You have local changes to '%s'; cannot switch branches.";
It's nice to get accurate messages for all cases, but then why do you keep the special-case for not_uptodate_file? If there's a good reason for it, a comment in the code would be welcome.
+ /* would_overwrite */ + msgs.would_overwrite = malloc(sizeof(char) * 72); + sprintf((char *)msgs.would_overwrite, + "Your local changes to '%%s' would be overwritten by %s. Aborting.", + cmd);
This yields: Your local changes to 'foo' would be overwritten by checkout. Aborting. I tend to prefer Junio's wording: You have local changes to 'foo'; cannot switch branches. -- Matthieu Moy http://www-verimag.imag.fr/~moy/