Skip to content

Commit 4d12888

Browse files
peffgitster
authored andcommitted
cherry-pick: prettify the advice message
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9791554 commit 4d12888

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

builtin-revert.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,16 @@ static char *help_msg(const char *name)
208208

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

213213
if (action == CHERRY_PICK) {
214-
strbuf_addf(&helpbuf,
215-
" When committing, use the option '-c %s'\n"
216-
"to retain authorship and message.",
214+
strbuf_addf(&helpbuf, " with: \n"
215+
"\n"
216+
" git commit -c %s\n",
217217
name);
218218
}
219+
else
220+
strbuf_addch(&helpbuf, '.');
219221
return strbuf_detach(&helpbuf, NULL);
220222
}
221223

0 commit comments

Comments
 (0)