<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-format-patch.adoc, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-03-27T20:10:12Z</updated>
<entry>
<title>format-patch: removing unconditional wrapping</title>
<updated>2026-03-27T20:10:12Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-27T19:48:10Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0284046ad01e22b5e794a864a96925791f75353c'/>
<id>urn:sha1:0284046ad01e22b5e794a864a96925791f75353c</id>
<content type='text'>
Using format-patch with --commit-list-format different than shortlog,
causes the commit entry lines to wrap if they get longer than
MAIL_DEFAULT_WRAP (72 characters).

While this might be sensible for many when sending changes through
email, it forces this decision of wrapping on the user, reducing the
control granularity of --commit-list-format.

Teach generate_commit_list_cover() to respect commit entry line lengths
and place this wrapping rule on the "modern" preset format instead.

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>docs: fix --commit-list-format related entries</title>
<updated>2026-03-27T20:09:50Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-27T19:48:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=acee42d3e5a2855cfa3b33baf3728f34fe6fb33f'/>
<id>urn:sha1:acee42d3e5a2855cfa3b33baf3728f34fe6fb33f</id>
<content type='text'>
Documentation specifies that "git format-patch" would default to
format.commitListFormat if --commit-list-format is not given, but
doesn't specify the default if the format.commitListFormat is not set.
The text for --cover-letter is also obsolete as the commit list can now
be something other than a shortlog.

Document to reflect changes.

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: --commit-list-format without prefix</title>
<updated>2026-03-23T20:06:59Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-23T16:57:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=36c16a5b7fff7806b475b5fa07eca3a5179d7fa6'/>
<id>urn:sha1:36c16a5b7fff7806b475b5fa07eca3a5179d7fa6</id>
<content type='text'>
Having to prefix a custom format-string with "log:" when passed from the
CLI can be annoying. It would be great if this prefix wasn't required.

Teach make_cover_letter() to accept custom format-strings without the
"log:" prefix if a placeholder is detected.

Note that both here and in "git log --format" the check is done naively
by just checking for the presence of a '%'.

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: add preset for --commit-list-format</title>
<updated>2026-03-23T20:06:59Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-23T16:57:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d022dc77ab81fcc005b9965e91f524d4a43e74b5'/>
<id>urn:sha1:d022dc77ab81fcc005b9965e91f524d4a43e74b5</id>
<content type='text'>
"git format-patch --commit-list-format" enables the user to make their
own format for the commit list in the cover letter. It would be nice to
have a ready to use format to replace shortlog.

Teach make_cover_letter() the "modern" format preset.
This new format is the same as: "log:[%(count)/%(total)] %s".

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: rename --cover-letter-format option</title>
<updated>2026-03-23T20:06:58Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-23T16:57:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=67ea2ad7d1b006194762cbfcc0b7801ffe652ca4'/>
<id>urn:sha1:67ea2ad7d1b006194762cbfcc0b7801ffe652ca4</id>
<content type='text'>
To align the name of the configuration variable and the name of the
command line option, either one should change name. By changing the name
of the option we get the added benefit of having --cover-&lt;TAB&gt; expand to
--cover-letter without ambiguity.

If the user gives the --cover-letter-format option it would be
reasonable to expect that the user wants to generate the cover letter
despite not giving --cover-letter.

Rename --cover-letter-format to --commit-list-format and make it imply
--cover-letter unless --no-cover-letter is given.

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mf/format-patch-cover-letter-format' into mf/format-patch-commit-list-format</title>
<updated>2026-03-16T19:42:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-16T19:42:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b3c222ed9103db7947b432a99d460e22bdc873ca'/>
<id>urn:sha1:b3c222ed9103db7947b432a99d460e22bdc873ca</id>
<content type='text'>
* mf/format-patch-cover-letter-format:
  docs: add usage for the cover-letter fmt feature
  format-patch: add commitListFormat config
  format-patch: add ability to use alt cover format
  format-patch: move cover letter summary generation
  pretty.c: add %(count) and %(total) placeholders
</content>
</entry>
<entry>
<title>docs: add usage for the cover-letter fmt feature</title>
<updated>2026-03-07T01:16:45Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-06T23:34:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=51ed9f7e724468b8e44a7c33946dda38a335acca'/>
<id>urn:sha1:51ed9f7e724468b8e44a7c33946dda38a335acca</id>
<content type='text'>
Document the new "--cover-letter-format" option in format-patch and its
related configuration variable "format.commitListFormat".

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mf/format-patch-honor-from-for-cover-letter'</title>
<updated>2026-02-27T23:11:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-27T23:11:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d64a20a1b185082fa6fc83b339f922f95fa45bdc'/>
<id>urn:sha1:d64a20a1b185082fa6fc83b339f922f95fa45bdc</id>
<content type='text'>
"git format-patch --from=&lt;me&gt;" did not honor the command line
option when writing out the cover letter, which has been corrected.

* mf/format-patch-honor-from-for-cover-letter:
  format-patch: fix From header in cover letter
</content>
</entry>
<entry>
<title>format-patch: fix From header in cover letter</title>
<updated>2026-02-17T23:29:57Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-02-17T23:25:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a8e89346a7731cb3104010f322c65e2a0c922618'/>
<id>urn:sha1:a8e89346a7731cb3104010f322c65e2a0c922618</id>
<content type='text'>
"git format-patch" takes "--from=&lt;user ident&gt;" command line option
and uses the given ident for patch e-mails, but this is not applied
to the cover letter, the option is ignored and the committer ident
of the current user is used. This has been the case ever since
"--from" was introduced in a9080475 (teach format-patch to place
other authors into in-body "From", 2013-07-03).

Teach the make_cover_letter() function to honor the option, instead of
always using the current committer identity. Change variable name from
"committer" to "from" to better reflect the purpose of the variable.

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: add caveat about round-tripping format-patch</title>
<updated>2026-02-12T22:37:56Z</updated>
<author>
<name>Kristoffer Haugsbakk</name>
<email>code@khaugsbakk.name</email>
</author>
<published>2026-02-12T22:28:23Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a454cdca42fda0afaade73d7e90010289d1e7ba8'/>
<id>urn:sha1:a454cdca42fda0afaade73d7e90010289d1e7ba8</id>
<content type='text'>
git-format-patch(1) and git-am(1) deal with formatting commits as
patches and applying them, respectively. Naturally they use a few
delimiters to mark where the commit message ends. This can lead to
surprising behavior when these delimiters are used in the commit
message itself.

git-format-patch(1) will accept any commit message and not warn or error
about these delimiters being used.[1]

Especially problematic is the presence of unindented diffs in the commit
message; the patch machinery will naturally (since the commit message
has ended) try to apply that diff and everything after it.[2]

It is unclear whether any commands in this chain will learn to warn
about this. One concern could be that users have learned to rely on
the three-dash line rule to conveniently add extra-commit message
information in the commit message, knowing that git-am(1) will
ignore it.[4]

All of this is covered already, technically. However, we should spell
out the implications.

† 1: There is also git-commit(1) to consider. However, making that
     command warn or error out over such delimiters would be disruptive
     to all Git users who never use email in their workflow.
† 2: Recently patch(1) caused this issue for a project, but it was noted
     that git-am(1) has the same behavior[3]
† 3: https://github.com/i3/i3/pull/6564#issuecomment-3858381425
† 4: https://lore.kernel.org/git/xmqqldh4b5y2.fsf@gitster.g/
     https://lore.kernel.org/git/V3_format-patch_caveats.354@msgid.xyz/

Reported-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Reported-by: Christoph Anton Mitterer &lt;calestyo@scientia.org&gt;
Reported-by: Matheus Tavares &lt;matheus.tavb@gmail.com&gt;
Reported-by: Chris Packham &lt;judge.packham@gmail.com&gt;
Helped-by: Jakob Haufe &lt;sur5r@sur5r.net&gt;
Helped-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Kristoffer Haugsbakk &lt;code@khaugsbakk.name&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
