{"thread":{"id":"36821","subject":"[PATCH] error_resolve_conflict: rewrap advice message","startedAt":"2014-06-03T07:17:17Z","lastAt":"2014-06-03T17:02:02Z","messageCount":3,"participants":["Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"243180","messageId":"20140603071717.GA32038@sigill.intra.peff.net","threadId":"36821","inReplyTo":null,"subject":"[PATCH] error_resolve_conflict: rewrap advice message","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-06-03T07:17:17Z","receivedAt":"2014-06-03T07:17:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If you try to commit with unresolved conflicts in the index,\nyou get this message:\n\n\t$ git commit\n\tU       foo\n\terror: 'commit' is not possible because you have unmerged files.\n\thint: Fix them up in the work tree,\n\thint: and then use 'git add/rm <file>' as\n\thint: appropriate to mark resolution and make a commit,\n\thint: or use 'git commit -a'.\n\tfatal: Exiting because of an unresolved conflict.\n\nThe irregular line-wrapping makes this awkward to read, and\nit takes up more lines than necessary. Instead, let's rewrap\nit to about 60 characters per line:\n\n\t$ git commit\n\tU       foo\n\terror: 'commit' is not possible because you have unmerged files.\n\thint: Fix them up in the work tree, and then use 'git add/rm <file>'\n\thint: as appropriate to mark resolution and make a commit, or use\n\thint: 'git commit -a'.\n\tfatal: Exiting because of an unresolved conflict.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis always bugs me when I see it, so I thought I'd finally do something\nabout it. I left the wording alone, though I'd also be happy to see it\nshortened to just advise \"git add/rm\" and not mention \"git commit -a\" at\nall.\n\n advice.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex 486f823..ef24733 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -82,10 +82,9 @@ int error_resolve_conflict(const char *me)\n \t\t * Message used both when 'git commit' fails and when\n \t\t * other commands doing a merge do.\n \t\t */\n-\t\tadvise(_(\"Fix them up in the work tree,\\n\"\n-\t\t\t \"and then use 'git add/rm <file>' as\\n\"\n-\t\t\t \"appropriate to mark resolution and make a commit,\\n\"\n-\t\t\t \"or use 'git commit -a'.\"));\n+\t\tadvise(_(\"Fix them up in the work tree, and then use 'git add/rm <file>'\\n\"\n+\t\t\t \"as appropriate to mark resolution and make a commit, or use\\n\"\n+\t\t\t \"'git commit -a'.\"));\n \treturn -1;\n }\n \n-- \n2.0.0.rc1.436.g03cb729\n"},{"id":"243181","messageId":"20140603072349.GA32206@sigill.intra.peff.net","threadId":"36821","inReplyTo":"20140603071717.GA32038@sigill.intra.peff.net","subject":"[PATCH] error_resolve_conflict: drop quotations around operation","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-06-03T07:23:49Z","receivedAt":"2014-06-03T07:23:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When you try to commit with unmerged entries, you get an\nerror like:\n\n  $ git commit\n  error: 'commit' is not possible because you have unmerged files.\n\nThe quotes around \"commit\" are clunky; the user doesn't care\nthat this message is a template with the command-name filled\nin.  Saying:\n\n  error: commit is not possible because you have unmerged files\n\nis easier to read. As this code is called from other places,\nwe may also end up with:\n\n  $ git merge\n  error: merge is not possible because you have unmerged files\n\n  $ git cherry-pick foo\n  error: cherry-pick is not possible because you have unmerged files\n\n  $ git revert foo\n  error: revert is not possible because you have unmerged files\n\nAll of which look better without the quotes. This also\nhappens to match the behavior of \"git pull\", which generates\na similar message (but does not share code, as it is a shell\nscript).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI realize this may just be a matter of taste, but I thought I'd put it\nforth as a possibility.\n\nI also considered switching the wording to:\n\n  error: cannot commit because you have unmerged files\n\nwhich I find a little more natural.\n\n advice.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/advice.c b/advice.c\nindex ef24733..c50ebdf 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -76,7 +76,7 @@ int git_default_advice_config(const char *var, const char *value)\n \n int error_resolve_conflict(const char *me)\n {\n-\terror(\"'%s' is not possible because you have unmerged files.\", me);\n+\terror(\"%s is not possible because you have unmerged files.\", me);\n \tif (advice_resolve_conflict)\n \t\t/*\n \t\t * Message used both when 'git commit' fails and when\n-- \n2.0.0.rc1.436.g03cb729\n"},{"id":"243195","messageId":"xmqq8upex6yc.fsf@gitster.dls.corp.google.com","threadId":"36821","inReplyTo":"20140603072349.GA32206@sigill.intra.peff.net","subject":"Re: [PATCH] error_resolve_conflict: drop quotations around operation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-03T17:02:02Z","receivedAt":"2014-06-03T17:02:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> When you try to commit with unmerged entries, you get an\n> error like:\n>\n>   $ git commit\n>   error: 'commit' is not possible because you have unmerged files.\n>\n> The quotes around \"commit\" are clunky; the user doesn't care\n> that this message is a template with the command-name filled\n> in.  Saying:\n>\n>   error: commit is not possible because you have unmerged files\n>\n> is easier to read. As this code is called from other places,\n> we may also end up with:\n>\n>   $ git merge\n>   error: merge is not possible because you have unmerged files\n>\n>   $ git cherry-pick foo\n>   error: cherry-pick is not possible because you have unmerged files\n>\n>   $ git revert foo\n>   error: revert is not possible because you have unmerged files\n>\n> All of which look better without the quotes. This also\n> happens to match the behavior of \"git pull\", which generates\n> a similar message (but does not share code, as it is a shell\n> script).\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> I realize this may just be a matter of taste, but I thought I'd put it\n> forth as a possibility.\n\nIf the template were filled with 'git commit', 'git merge', etc.,\nthen the quotes around %s may make it clearer, but 'me' here is\ndesigned to be a single subcommand name, so this change is good.\n\n> I also considered switching the wording to:\n>\n>   error: cannot commit because you have unmerged files\n>\n> which I find a little more natural.\n\nPerhaps.  As long as the subcommand name that can come here as 'me'\nis always a verb, that would work (I didn't think about l10n, tho).\n\n>  advice.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/advice.c b/advice.c\n> index ef24733..c50ebdf 100644\n> --- a/advice.c\n> +++ b/advice.c\n> @@ -76,7 +76,7 @@ int git_default_advice_config(const char *var, const char *value)\n>  \n>  int error_resolve_conflict(const char *me)\n>  {\n> -\terror(\"'%s' is not possible because you have unmerged files.\", me);\n> +\terror(\"%s is not possible because you have unmerged files.\", me);\n>  \tif (advice_resolve_conflict)\n>  \t\t/*\n>  \t\t * Message used both when 'git commit' fails and when\n"}]}