MCPcopy Create free account
hub / github.com/git/git / vadvise

Function vadvise

advice.c:100–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 "Disable this message with \"git config set advice.%s false\"");
99
100static void vadvise(const char *advice, int display_instructions,
101 const char *key, va_list params)
102{
103 struct strbuf buf = STRBUF_INIT;
104 const char *cp, *np;
105
106 strbuf_vaddf(&buf, advice, params);
107
108 if (display_instructions)
109 strbuf_addf(&buf, turn_off_instructions, key);
110
111 for (cp = buf.buf; *cp; cp = np) {
112 np = strchrnul(cp, '\n');
113 fprintf(stderr, _("%shint:%s%.*s%s\n"),
114 advise_get_color(ADVICE_COLOR_HINT),
115 (np == cp) ? "" : " ",
116 (int)(np - cp), cp,
117 advise_get_color(ADVICE_COLOR_RESET));
118 if (*np)
119 np++;
120 }
121 strbuf_release(&buf);
122}
123
124void advise(const char *advice, ...)
125{

Callers 2

adviseFunction · 0.85
advise_if_enabledFunction · 0.85

Calls 4

strbuf_vaddfFunction · 0.85
strbuf_addfFunction · 0.85
advise_get_colorFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected