Merge branch 'pw/3.0-commentchar-auto-deprecation'
"core.commentChar=auto" that attempts to dynamically pick a suitable comment character is non-workable, as it is too much trouble to support for little benefit, and is marked as deprecated. * pw/3.0-commentchar-auto-deprecation: commit: print advice when core.commentString=auto config: warn on core.commentString=auto breaking-changes: deprecate support for core.commentString=auto
This commit is contained in:
@@ -695,6 +695,7 @@ static int author_date_is_interesting(void)
|
||||
return author_message || force_date;
|
||||
}
|
||||
|
||||
#ifndef WITH_BREAKING_CHANGES
|
||||
static void adjust_comment_line_char(const struct strbuf *sb)
|
||||
{
|
||||
char candidates[] = "#;@!$%^&|:";
|
||||
@@ -732,6 +733,7 @@ static void adjust_comment_line_char(const struct strbuf *sb)
|
||||
free(comment_line_str_to_free);
|
||||
comment_line_str = comment_line_str_to_free = xstrfmt("%c", *p);
|
||||
}
|
||||
#endif /* !WITH_BREAKING_CHANGES */
|
||||
|
||||
static void prepare_amend_commit(struct commit *commit, struct strbuf *sb,
|
||||
struct pretty_print_context *ctx)
|
||||
@@ -928,8 +930,10 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
|
||||
if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len)
|
||||
die_errno(_("could not write commit template"));
|
||||
|
||||
#ifndef WITH_BREAKING_CHANGES
|
||||
if (auto_comment_line_char)
|
||||
adjust_comment_line_char(&sb);
|
||||
#endif /* !WITH_BREAKING_CHANGES */
|
||||
strbuf_release(&sb);
|
||||
|
||||
/* This checks if committer ident is explicitly given */
|
||||
@@ -1793,6 +1797,9 @@ int cmd_commit(int argc,
|
||||
show_usage_with_options_if_asked(argc, argv,
|
||||
builtin_commit_usage, builtin_commit_options);
|
||||
|
||||
#ifndef WITH_BREAKING_CHANGES
|
||||
warn_on_auto_comment_char = true;
|
||||
#endif /* !WITH_BREAKING_CHANGES */
|
||||
prepare_repo_settings(the_repository);
|
||||
the_repository->settings.command_requires_full_index = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user