git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 15, 2010, 12:36 UTC
Message-ID
<vpqr5k8zd4z.fsf@bauges.imag.fr>
In-Reply-To
<1276604576-28092-2-git-send-email-diane.gasselin@ensimag.imag.fr>
Diane Gasselin <diane.gasselin@ensimag.imag.fr> writes:
Show 8 quoted lines
> --- 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.

Show 5 quoted lines
> +	/* 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/

Previous: Diane Gasselin
Message 13 of 13 in “unpack_trees: nicer error messages”
  1. 0/5 unpack_trees: nicer error messagesDiane Gasselin, Jun 15, 2010
  2. 1/5 merge-recursive: porcelain messages for checkoutDiane Gasselin, Jun 15, 2010
  3. 2/5 unpack_trees: group errors by typeDiane Gasselin, Jun 15, 2010
  4. 3/5 unpack_trees_options: update porcelain messagesDiane Gasselin, Jun 15, 2010
  5. 4/5 tests: update porcelain expected messageDiane Gasselin, Jun 15, 2010
  6. 5/5 t7609: test merge and checkout error messagesDiane Gasselin, Jun 15, 2010
  7. Matthieu MoyJun 15, 2010
  8. Matthieu MoyJun 15, 2010
  9. Matthieu MoyJun 15, 2010
  10. Diane GasselinJun 15, 2010
  11. Matthieu MoyJun 15, 2010
  12. Diane GasselinJun 15, 2010
  13. Matthieu MoyJun 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.