Skip to content

Commit

Permalink
cherry-pick: prettify the advice message
Browse files Browse the repository at this point in the history
It's hard to see the "how to commit" part of this message,
which users may want to cut and paste. On top of that,
having it in paragraph form means that a really long commit
name may cause ugly wrapping. Let's make it prettier, like:

  Automatic cherry-pick failed.  After resolving the conflicts,
  mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
  and commit the result with:

          git commit -c HEAD~23

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
peff authored and gitster committed Feb 12, 2010
1 parent 9791554 commit 4d12888
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions builtin-revert.c
Expand Up @@ -208,14 +208,16 @@ static char *help_msg(const char *name)

strbuf_addstr(&helpbuf, " After resolving the conflicts,\n"
"mark the corrected paths with 'git add <paths>' or 'git rm <paths>'\n"
"and commit the result.");
"and commit the result");

if (action == CHERRY_PICK) {
strbuf_addf(&helpbuf,
" When committing, use the option '-c %s'\n"
"to retain authorship and message.",
strbuf_addf(&helpbuf, " with: \n"
"\n"
" git commit -c %s\n",
name);
}
else
strbuf_addch(&helpbuf, '.');
return strbuf_detach(&helpbuf, NULL);
}

Expand Down

0 comments on commit 4d12888

Please sign in to comment.