From c057b2424a479a2219666f3806c0dd93867ca5c9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 3 Jun 2014 03:17:17 -0400 Subject: error_resolve_conflict: rewrap advice message If you try to commit with unresolved conflicts in the index, you get this message: $ git commit U foo error: 'commit' is not possible because you have unmerged files. hint: Fix them up in the work tree, hint: and then use 'git add/rm ' as hint: appropriate to mark resolution and make a commit, hint: or use 'git commit -a'. fatal: Exiting because of an unresolved conflict. The irregular line-wrapping makes this awkward to read, and it takes up more lines than necessary. Instead, let's rewrap it to about 60 characters per line: $ git commit U foo error: 'commit' is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm ' hint: as appropriate to mark resolution and make a commit, or use hint: 'git commit -a'. fatal: Exiting because of an unresolved conflict. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- advice.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'advice.c') diff --git a/advice.c b/advice.c index 3eca9f5ff..d458ae774 100644 --- a/advice.c +++ b/advice.c @@ -84,10 +84,9 @@ int error_resolve_conflict(const char *me) * Message used both when 'git commit' fails and when * other commands doing a merge do. */ - advise(_("Fix them up in the work tree,\n" - "and then use 'git add/rm ' as\n" - "appropriate to mark resolution and make a commit,\n" - "or use 'git commit -a'.")); + advise(_("Fix them up in the work tree, and then use 'git add/rm '\n" + "as appropriate to mark resolution and make a commit, or use\n" + "'git commit -a'.")); return -1; } -- cgit v1.2.3 From d795216ac35f08e1ae2a706fca4c06a887c7d797 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 3 Jun 2014 03:23:49 -0400 Subject: error_resolve_conflict: drop quotations around operation When you try to commit with unmerged entries, you get an error like: $ git commit error: 'commit' is not possible because you have unmerged files. The quotes around "commit" are clunky; the user doesn't care that this message is a template with the command-name filled in. Saying: error: commit is not possible because you have unmerged files is easier to read. As this code is called from other places, we may also end up with: $ git merge error: merge is not possible because you have unmerged files $ git cherry-pick foo error: cherry-pick is not possible because you have unmerged files $ git revert foo error: revert is not possible because you have unmerged files All of which look better without the quotes. This also happens to match the behavior of "git pull", which generates a similar message (but does not share code, as it is a shell script). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- advice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'advice.c') diff --git a/advice.c b/advice.c index d458ae774..07d0109d6 100644 --- a/advice.c +++ b/advice.c @@ -78,7 +78,7 @@ int git_default_advice_config(const char *var, const char *value) int error_resolve_conflict(const char *me) { - error("'%s' is not possible because you have unmerged files.", me); + error("%s is not possible because you have unmerged files.", me); if (advice_resolve_conflict) /* * Message used both when 'git commit' fails and when -- cgit v1.2.3