threads / patch / 24909

patchinsert missing newline in a diagnostic

Subject: [PATCH for next] insert missing newline in a diagnostic

## tl;dr

2 messages between Aug 30, 2010 and Sep 1, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jim Meyering· Aug 30, 2010, 09:40 UTC · lore
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(-)
Show changes to merge-recursive.c +1 −2
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· Sep 1, 2010, 00:17 UTC · re: Jim Meyering · lore

Re: [PATCH for next] insert missing newline in a diagnostic

(+cc: Matthieu, Junio)
Hi Jim,
Jim Meyering wrote:
Show 6 quoted lines
> 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

← back to recent threads