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

Re: [PATCH 1/2] merge-recursive: point the user to commit when file would be overwritten.

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2009, 18:05 UTC
Message-ID
<7vskc9vzqg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1258732767-12741-2-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 5 quoted lines
> The commit-before-pull is well accepted in the DVCS community, but is
> confusing some new users. This should get them back in the right way when
> the problem occurs.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Don't these extra lines warrant "advice.*" option?
Show 24 quoted lines
> ---
>  merge-recursive.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index f55b7eb..d5e0819 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -172,9 +172,11 @@ static int git_merge_trees(int index_only,
>  	struct unpack_trees_options opts;
>  	static const struct unpack_trees_error_msgs msgs = {
>  		/* would_overwrite */
> -		"Your local changes to '%s' would be overwritten by merge.  Aborting.",
> +		"Your local changes to '%s' would be overwritten by merge.  Aborting:\n"
> +		"Please, commit your changes or stash them before you can merge.",
>  		/* not_uptodate_file */
> -		"Your local changes to '%s' would be overwritten by merge.  Aborting.",
> +		"Your local changes to '%s' would be overwritten by merge.  Aborting:\n"
> +		"Please, commit your changes or stash them before you can merge.",
>  		/* not_uptodate_dir */
>  		"Updating '%s' would lose untracked files in it.  Aborting.",
>  		/* would_lose_untracked */
> -- 
> 1.6.5.3.435.g5f2e3.dirty
Previous: Matthieu MoyNext: Matthieu Moy
Message 3 of 12 in “Explain newbies the "commit before pull" flow”
  1. 0/2 Explain newbies the "commit before pull" flowMatthieu Moy, Nov 20, 2009
  2. 1/2 merge-recursive: point the user to commit when file would be overwritten.Matthieu Moy, Nov 20, 2009
  3. Junio C HamanoNov 20, 2009
  4. Matthieu MoyNov 22, 2009
  5. 2/2 user-manual: Document that "git merge" doesn't like uncommited changes.Matthieu Moy, Nov 20, 2009
  6. Junio C HamanoNov 20, 2009
  7. Matthieu MoyNov 22, 2009
  8. Junio C HamanoNov 22, 2009
  9. Matthieu MoyNov 23, 2009
  10. 1/2 merge-recursive: point the user to commit when file would be overwritten.Matthieu Moy, Nov 22, 2009
  11. 2/2 user-manual: Document that "git merge" doesn't like uncommited changes.Matthieu Moy, Nov 22, 2009
  12. Junio C HamanoNov 23, 2009

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.