<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4014-format-patch.sh, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-03T22:24:45Z</updated>
<entry>
<title>Merge branch 'ps/dash-buggy-0.5.13-workaround'</title>
<updated>2026-04-03T22:24:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-03T22:24:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc9afb66cf013dd8f80dfeffb595de1f27ef7a89'/>
<id>urn:sha1:dc9afb66cf013dd8f80dfeffb595de1f27ef7a89</id>
<content type='text'>
The way dash 0.5.13 handles non-ASCII contents in here-doc
is buggy and breaks our existing tests, which unfortunately
have been rewritten to avoid triggering the bug.

* ps/dash-buggy-0.5.13-workaround:
  t9300: work around partial read bug in Dash v0.5.13
  t: work around multibyte bug in quoted heredocs with Dash v0.5.13
</content>
</entry>
<entry>
<title>t: work around multibyte bug in quoted heredocs with Dash v0.5.13</title>
<updated>2026-04-02T18:39:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-04-02T06:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c8424c259b417c6aadc23f5398e55edd7b047a2'/>
<id>urn:sha1:0c8424c259b417c6aadc23f5398e55edd7b047a2</id>
<content type='text'>
When executing our test suite with Dash v0.5.13.2 one can observe
several test failures that all have the same symptoms: we have a quoted
heredoc that contains multibyte characters, but the final data does not
match what we actually wanted to write. One such example is in t0300,
where we see the diffs like the following:

  --- expect-stdout	2026-04-01 07:25:45.249919440 +0000
  +++ stdout	2026-04-01 07:25:45.254919509 +0000
  @@ -1,5 +1,5 @@
   protocol=https
   host=example.com
  -path=perú.git
  +path=perú.git
   username=foo
   password=bar

While seemingly the same, the data that we've written via the heredoc
contains some invisible bytes. The expected hex representation of the
string is:

  7065 72c3 ba2e 6769 74                 per...git

But what we actually get instead is this string:

  7065 7285 02c3 ba02 852e 6769 74       per.......git

What's important to note here is that the multibyte character exists in
both versions. But in the broken version we see that the bytes are
wrapped in a sequence of "85 02" and "02 85". This is the CTLMBCHAR byte
sequence of Dash, which it uses internally to quote multibyte sequences.

As it turns out, this bug was introduced in c5bf970 (expand: Add
multi-byte support to pmatch, 2024-06-02), which adds multibyte support
to more contexts of Dash. One of these contexts seems to be in heredocs,
and Dash _does_ correctly unquote these multibyte sequences when using
an unquoted heredoc. But the bug seems to be that this unquoting does
not happen in quoted heredocs, and the bug still exists on the latest
"master" branch.

For now, work around the bug by using unquoted heredocs instead.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&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='https://git.shady.money/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='https://git.shady.money/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.commitListFormat: strip meaning from empty</title>
<updated>2026-03-23T20:06:59Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-23T16:57:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=24d174f9917cce804c9057061f7da0dbd3b88a24'/>
<id>urn:sha1:24d174f9917cce804c9057061f7da0dbd3b88a24</id>
<content type='text'>
The configuration variable format.commitListFormat allows for an empty
value. This is unusual and can create issues when interacting with this
configuration variable through the CLI.

Strip meaning to format.commitListFormat with an empty value.

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='https://git.shady.money/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='https://git.shady.money/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>Merge branch 'kh/format-patch-noprefix-is-boolean'</title>
<updated>2026-03-10T21:23:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-10T21:23:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a8aebae972de22ecd5adb92fec9d77147949c8a'/>
<id>urn:sha1:9a8aebae972de22ecd5adb92fec9d77147949c8a</id>
<content type='text'>
The configuration variable format.noprefix did not behave as a
proper boolean variable, which has now been fixed and documented.

* kh/format-patch-noprefix-is-boolean:
  doc: diff-options.adoc: make *.noprefix split translatable
  doc: diff-options.adoc: show format.noprefix for format-patch
  format-patch: make format.noprefix a boolean
</content>
</entry>
<entry>
<title>format-patch: add commitListFormat config</title>
<updated>2026-03-07T01:16:44Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-06T23:34:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be0ef6fcd2379ea3dc1569d6d8c360d6d59d031f'/>
<id>urn:sha1:be0ef6fcd2379ea3dc1569d6d8c360d6d59d031f</id>
<content type='text'>
Using "--cover-letter" we can tell format-patch to generate a cover
letter, in this cover letter there's a list of commits included in the
patch series and the format is specified by the "--cover-letter-format"
option. Would be useful if this format could be configured from the
config file instead of always needing to pass it from the command line.

Teach format-patch how to read the format spec for the cover letter from
the config files. The variable it should look for is called
format.commitListFormat.

Possible values:
  - commitListFormat is set but no string is passed: it will default to
    "[%(count)/%(total)] %s"

  - if a string is passed: will use it as a format spec. Note that this
    is either "shortlog" or a format spec prefixed by "log:"
    e.g."log:%s (%an)"

  - if commitListFormat is not set: it will default to the shortlog
    format.

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 ability to use alt cover format</title>
<updated>2026-03-07T01:16:44Z</updated>
<author>
<name>Mirko Faina</name>
<email>mroik@delayed.space</email>
</author>
<published>2026-03-06T23:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6005932d95ff05541f9dbe8c49a45b7abaf7432e'/>
<id>urn:sha1:6005932d95ff05541f9dbe8c49a45b7abaf7432e</id>
<content type='text'>
Often when sending patch series there's a need to clarify to the
reviewer what's the purpose of said series, since it might be difficult
to understand it from reading the commits messages one by one.

"git format-patch" provides the useful "--cover-letter" flag to declare
if we want it to generate a template for us to use. By default it will
generate a "git shortlog" of the changes, which developers find less
useful than they'd like, mainly because the shortlog groups commits by
author, and gives no obvious chronological order.

Give format-patch the ability to specify an alternative format spec
through the "--cover-letter-format" option. This option either takes
"shortlog", which is the current format, or a format spec prefixed with
"log:".

Example:
    git format-patch --cover-letter \
        --cover-letter-format="log:[%(count)/%(total)] %s (%an)" HEAD~3

    [1/3] this is a commit summary (Mirko Faina)
    [2/3] this is another commit summary (Mirko Faina)
    ...

Signed-off-by: Mirko Faina &lt;mroik@delayed.space&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
