| 2180 | } |
| 2181 | |
| 2182 | static void add_comment_char_advice(struct repository *repo, |
| 2183 | struct comment_char_config *config) |
| 2184 | { |
| 2185 | struct strbuf buf = STRBUF_INIT; |
| 2186 | struct comment_char_config_item *item; |
| 2187 | /* TRANSLATORS this is a place holder for the value of core.commentString */ |
| 2188 | const char *placeholder = _("<comment string>"); |
| 2189 | |
| 2190 | /* |
| 2191 | * If auto is set in the last file that we saw advise the user how to |
| 2192 | * update their config. |
| 2193 | */ |
| 2194 | if (!config->auto_set_in_file) |
| 2195 | return; |
| 2196 | |
| 2197 | add_unset_auto_comment_char_advice(repo, config); |
| 2198 | item = &config->item[config->nr - 1]; |
| 2199 | strbuf_reset(&buf); |
| 2200 | strbuf_addstr(&buf, " git config set "); |
| 2201 | add_config_scope_arg(repo, &buf, item); |
| 2202 | strbuf_addf(&buf, "%s %s\n", comment_key_name(item->key_id), |
| 2203 | placeholder); |
| 2204 | advise(_("\nTo set a custom comment string please run\n\n" |
| 2205 | "%s\nwhere '%s' is the string you wish to use.\n"), |
| 2206 | buf.buf, placeholder); |
| 2207 | strbuf_release(&buf); |
| 2208 | } |
| 2209 | |
| 2210 | #undef KEY_SEEN_ONCE |
| 2211 | #undef KEY_SEEN_TWICE |
no test coverage detected