# [PATCH for next] insert missing newline in a diagnostic

2 messages from 2010-08-30 to 2010-09-01. Participants: Jim Meyering, Jonathan Nieder.
Thread: https://gitlist.dev/t/24909

## Jim Meyering, 2010-08-30 09:40

Subject: [PATCH for next] insert missing newline in a diagnostic
Message-ID: <87iq2s4ewn.fsf@meyering.net>
URL: https://gitlist.dev/e/87iq2s4ewn.fsf%40meyering.net

```

When merging, I would get a message like this:

  error: The following untracked working tree files would be overwritten by merge:
  FILE_NAMEPlease move or remove them before you can merge.

This change inserts the newline after FILE_NAME.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 merge-recursive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index aadd48c..e81c995 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1307,7 +1307,7 @@ void set_porcelain_error_msgs(const char **msgs, const char *cmd)
 		"Updating the following directories would lose untracked files in it:\n%s";

 	if (advice_commit_before_merge)
-		msg = "The following untracked working tree files would be %s by %s:\n%%s"
+		msg = "The following untracked working tree files would be %s by %s:\n%%s\n"
 			"Please move or remove them before you can %s.";
 	else
 		msg = "The following untracked working tree files would be %s by %s:\n%%s";
--
1.7.2.2.510.g7180a

```

## Jonathan Nieder, 2010-09-01 00:17

Subject: Re: [PATCH for next] insert missing newline in a diagnostic
Message-ID: <20100901001729.GG6747@burratino>
URL: https://gitlist.dev/e/20100901001729.GG6747%40burratino
In-Reply-To: <87iq2s4ewn.fsf@meyering.net>

```
(+cc: Matthieu, Junio)

Hi Jim,

Jim Meyering wrote:

> When merging, I would get a message like this:
> 
>   error: The following untracked working tree files would be overwritten by merge:
>   FILE_NAMEPlease move or remove them before you can merge.
> 
> This change inserts the newline after FILE_NAME.

I fear it is more complicated.  With your patch, in some situations
(e.g., when running t7609-merge-co-error-msgs.sh) I get a leading tab
and extra newline:

 error: The following untrack...
	FILE_NAME

 Please move or remove them before you can merge.

In unpack-trees, display_error_msgs() prints the version with a tab
but you are getting the message from add_rejected_path which suggests
to me that o->show_all_errors is unset.

Was there some other error before then?

Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/152965/focus=153211

```
