diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-03-20 15:53:30 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-03-20 15:53:30 -0700 |
commit | 0f360763c02d1230614e23f94fb298dab0162aa0 (patch) | |
tree | 3c4645bcc34807e9a63b904ea163cc73b8ddd970 /advice.c | |
parent | a46034819ecce6872bff099f3d75589f4d38c00c (diff) | |
parent | d4c813d47d5c4f821a6947a29e4a480ec6522f44 (diff) | |
download | git-0f360763c02d1230614e23f94fb298dab0162aa0.tar.gz git-0f360763c02d1230614e23f94fb298dab0162aa0.tar.xz |
Merge branch 'maint-1.7.8' into maint
* maint-1.7.8:
t/Makefile: Use $(sort ...) explicitly where needed
gitweb: Fix actionless dispatch for non-existent objects
i18n of multi-line advice messages
Diffstat (limited to 'advice.c')
-rw-r--r-- | advice.c | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -21,11 +21,21 @@ static struct { void advise(const char *advice, ...) { + struct strbuf buf = STRBUF_INIT; va_list params; + const char *cp, *np; va_start(params, advice); - vreportf("hint: ", advice, params); + strbuf_addf(&buf, advice, params); va_end(params); + + for (cp = buf.buf; *cp; cp = np) { + np = strchrnul(cp, '\n'); + fprintf(stderr, _("hint: %.*s\n"), (int)(np - cp), cp); + if (*np) + np++; + } + strbuf_release(&buf); } int git_default_advice_config(const char *var, const char *value) @@ -46,16 +56,15 @@ 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); - if (advice_resolve_conflict) { + if (advice_resolve_conflict) /* * Message used both when 'git commit' fails and when * other commands doing a merge do. */ - advise("Fix them up in the work tree,"); - advise("and then use 'git add/rm <file>' as"); - advise("appropriate to mark resolution and make a commit,"); - advise("or use 'git commit -a'."); - } + advise(_("Fix them up in the work tree,\n" + "and then use 'git add/rm <file>' as\n" + "appropriate to mark resolution and make a commit,\n" + "or use 'git commit -a'.")); return -1; } |