@@ -21,11 +21,21 @@ static struct {
2121
2222void advise (const char * advice , ...)
2323{
24+ struct strbuf buf = STRBUF_INIT ;
2425 va_list params ;
26+ const char * cp , * np ;
2527
2628 va_start (params , advice );
27- vreportf ( "hint: " , advice , params );
29+ strbuf_addf ( & buf , advice , params );
2830 va_end (params );
31+
32+ for (cp = buf .buf ; * cp ; cp = np ) {
33+ np = strchrnul (cp , '\n' );
34+ fprintf (stderr , _ ("hint: %.*s\n" ), (int )(np - cp ), cp );
35+ if (* np )
36+ np ++ ;
37+ }
38+ strbuf_release (& buf );
2939}
3040
3141int 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)
4656int error_resolve_conflict (const char * me )
4757{
4858 error ("'%s' is not possible because you have unmerged files." , me );
49- if (advice_resolve_conflict ) {
59+ if (advice_resolve_conflict )
5060 /*
5161 * Message used both when 'git commit' fails and when
5262 * other commands doing a merge do.
5363 */
54- advise ("Fix them up in the work tree," );
55- advise ("and then use 'git add/rm <file>' as" );
56- advise ("appropriate to mark resolution and make a commit," );
57- advise ("or use 'git commit -a'." );
58- }
64+ advise (_ ("Fix them up in the work tree,\n"
65+ "and then use 'git add/rm <file>' as\n"
66+ "appropriate to mark resolution and make a commit,\n"
67+ "or use 'git commit -a'." ));
5968 return -1 ;
6069}
6170
0 commit comments