Skip to content

Commit 29bac1a

Browse files
committed
Merge branch 'mf/format-patch-commit-list-format-doc' into jch
Doc updates. * mf/format-patch-commit-list-format-doc: format-patch: removing unconditional wrapping docs: fix --commit-list-format related entries
2 parents 663ab3c + 0284046 commit 29bac1a

3 files changed

Lines changed: 15 additions & 20 deletions

File tree

Documentation/config/format.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ format.coverLetter::
103103

104104
format.commitListFormat::
105105
When the `--cover-letter-format` option is not given, `format-patch`
106-
uses the value of this variable to decide how to format the title of
106+
uses the value of this variable to decide how to format the entry of
107107
each commit. Defaults to `shortlog`.
108108

109109
format.outputDirectory::

Documentation/git-format-patch.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,21 @@ feeding the result to `git send-email`.
319319
320320
--cover-letter::
321321
--no-cover-letter::
322-
In addition to the patches, generate a cover letter file
323-
containing the branch description, shortlog and the overall diffstat. You can
324-
fill in a description in the file before sending it out.
322+
In addition to the patches, generate a cover letter file containing the
323+
branch description, commit list and the overall diffstat. You can fill
324+
in a description in the file before sending it out.
325325
326326
--commit-list-format=<format-spec>::
327327
Specify the format in which to generate the commit list of the patch
328-
series. The accepted values for format-spec are `shortlog`, `modern` or a
329-
format-string prefixed with `log:`.
330-
e.g. `log: %s (%an)`
331-
The user is allowed to drop the prefix if the format-string contains a
332-
`%<placeholder>`.
333-
If not given, defaults to the `format.commitListFormat` configuration
334-
variable.
335-
This option implies the use of `--cover-letter` unless
336-
`--no-cover-letter` is given.
328+
series. The accepted values for format-spec are `shortlog`, `modern` or
329+
a format-string prefixed with `log:`. E.g. `log: %s (%an)`.
330+
`modern` is the same as `log:%w(72)[%(count)/%(total)] %s`.
331+
The `log:` prefix can be omitted if the format-string has a `%` in it
332+
(expecting that it is part of `%<placeholder>`).
333+
Defaults to the `format.commitListFormat` configuration variable, if
334+
set, or `shortlog`.
335+
This option given from the command-line implies the use of
336+
`--cover-letter` unless `--no-cover-letter` is given.
337337
338338
--encode-email-headers::
339339
--no-encode-email-headers::

builtin/log.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,6 @@ static void generate_commit_list_cover(FILE *cover_file, const char *format,
13651365
struct commit **list, int n)
13661366
{
13671367
struct strbuf commit_line = STRBUF_INIT;
1368-
struct strbuf wrapped_line = STRBUF_INIT;
13691368
struct pretty_print_context ctx = {0};
13701369
struct rev_info rev = REV_INFO_INIT;
13711370

@@ -1375,16 +1374,12 @@ static void generate_commit_list_cover(FILE *cover_file, const char *format,
13751374
rev.nr = i;
13761375
repo_format_commit_message(the_repository, list[n - i], format,
13771376
&commit_line, &ctx);
1378-
strbuf_add_wrapped_text(&wrapped_line, commit_line.buf, 0, 0,
1379-
MAIL_DEFAULT_WRAP);
1380-
fprintf(cover_file, "%s\n", wrapped_line.buf);
1377+
fprintf(cover_file, "%s\n", commit_line.buf);
13811378
strbuf_reset(&commit_line);
1382-
strbuf_reset(&wrapped_line);
13831379
}
13841380
fprintf(cover_file, "\n");
13851381

13861382
strbuf_release(&commit_line);
1387-
strbuf_release(&wrapped_line);
13881383
}
13891384

13901385
static void make_cover_letter(struct rev_info *rev, int use_separate_file,
@@ -1446,7 +1441,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
14461441
else if (!strcmp(format, "shortlog"))
14471442
generate_shortlog_cover_letter(&log, rev, list, nr);
14481443
else if (!strcmp(format, "modern"))
1449-
generate_commit_list_cover(rev->diffopt.file, "[%(count)/%(total)] %s",
1444+
generate_commit_list_cover(rev->diffopt.file, "%w(72)[%(count)/%(total)] %s",
14501445
list, nr);
14511446
else if (strchr(format, '%'))
14521447
generate_commit_list_cover(rev->diffopt.file, format, list, nr);

0 commit comments

Comments
 (0)