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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Feb 11, 2010 at 16:19 UTC
4d128884fbcce6c7effc729e1c52f06ce17037ee
1 file changed
+6
-4
builtin-revert.c
+6
-4
@@ -208,14 +208,16 @@ static char *help_msg(const char *name)
208
209
strbuf_addstr(&helpbuf, " After resolving the conflicts,\n"
210
"mark the corrected paths with 'git add <paths>' or 'git rm <paths>'\n"
211
- "and commit the result.");
211
+ "and commit the result");
212
213
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",
217
name);
218
}
219
+ else
220
+ strbuf_addch(&helpbuf, '.');
221
return strbuf_detach(&helpbuf, NULL);
222
}
223