Re: [PATCH 1/5 v2] merge-recursive: porcelain messages for checkout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Diane Gasselin <diane.gasselin@xxxxxxxxxxxxxxx> writes:

> --- 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]