<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4014-format-patch.sh, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-04-21T22:35:05Z</updated>
<entry>
<title>Merge branch 'ah/format-patch-thread-doc'</title>
<updated>2023-04-21T22:35:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-04-21T22:35:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9e0d1aa495bd26f4688b915ac5c3cb656c9f7174'/>
<id>urn:sha1:9e0d1aa495bd26f4688b915ac5c3cb656c9f7174</id>
<content type='text'>
Doc update.

* ah/format-patch-thread-doc:
  format-patch: correct documentation of --thread without an argument
</content>
</entry>
<entry>
<title>Merge branch 'jc/spell-id-in-both-caps-in-message-id'</title>
<updated>2023-04-11T20:49:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-04-11T20:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=647a2bb3ffc02ed06a36d6bae35e76004e9f97d7'/>
<id>urn:sha1:647a2bb3ffc02ed06a36d6bae35e76004e9f97d7</id>
<content type='text'>
Consistently spell "Message-ID" as such, not "Message-Id".

* jc/spell-id-in-both-caps-in-message-id:
  e-mail workflow: Message-ID is spelled with ID in both capital letters
</content>
</entry>
<entry>
<title>format-patch: correct documentation of --thread without an argument</title>
<updated>2023-04-03T16:59:20Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2023-04-03T04:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f024913164ae6ec53bd97c0fb8481abb0fecd86d'/>
<id>urn:sha1:f024913164ae6ec53bd97c0fb8481abb0fecd86d</id>
<content type='text'>
In Git, almost all command line flags unconditionally override the
corresponding config option.[1] Add a test to confirm that this is the
case for `git format-patch --thread`.

[1] https://lore.kernel.org/git/CAMMLpeS3+NUQa2oqpHKVo3yWQNVMgkEXrs4U5_ggvk31yQbezQ@mail.gmail.com/

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>e-mail workflow: Message-ID is spelled with ID in both capital letters</title>
<updated>2023-04-03T15:55:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-12-16T01:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba4324c4e1e32a28381ea1f4835b78e4c9d45575'/>
<id>urn:sha1:ba4324c4e1e32a28381ea1f4835b78e4c9d45575</id>
<content type='text'>
We used to write "Message-Id:" and "Message-ID:" pretty much
interchangeably, and the header name is defined to be case
insensitive by the RFCs, but the canonical form "Message-ID:" is
used throughout the RFC documents, so let's imitate it ourselves.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/format-patch-ignore-noprefix'</title>
<updated>2023-03-21T21:18:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-03-21T21:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15108de2fa0cd8f002a0551d14c84505a853071c'/>
<id>urn:sha1:15108de2fa0cd8f002a0551d14c84505a853071c</id>
<content type='text'>
"git format-patch" honors the src/dst prefixes set to nonstandard
values with configuration variables like "diff.noprefix", causing
receiving end of the patch that expects the standard -p1 format to
break.  Teach "format-patch" to ignore end-user configuration and
always use the standard prefixes.

This is a backward compatibility breaking change.

* jk/format-patch-ignore-noprefix:
  rebase: prefer --default-prefix to --{src,dst}-prefix for format-patch
  format-patch: add format.noprefix option
  format-patch: do not respect diff.noprefix
  diff: add --default-prefix option
  t4013: add tests for diff prefix options
  diff: factor out src/dst prefix setup
</content>
</entry>
<entry>
<title>format-patch: add format.noprefix option</title>
<updated>2023-03-09T16:37:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-03-09T06:12:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d5213decff887b2d950b732e37b7abad6f8d450'/>
<id>urn:sha1:8d5213decff887b2d950b732e37b7abad6f8d450</id>
<content type='text'>
The previous commit dropped support for diff.noprefix in format-patch.
While this will do the right thing in most cases (where sending patches
without a prefix was an accidental side effect of the sender preferring
to see their local patches without prefixes), it left no good option for
a project or workflow where you really do want to send patches without
prefixes. You'd be stuck using "--no-prefix" for every invocation.

So let's add a config option specific to format-patch that enables this
behavior. That gives people who have such a workflow a way to get what
they want, but makes it hard to accidentally trigger it.

A more backwards-compatible way of doing the transition would be to have
format.noprefix default to diff.noprefix when it's not set. But that
doesn't really help the "accidental" problem; people would have to
manually set format.noprefix=false. And it's unlikely that anybody
really wants format.noprefix=true in the first place. I'm adding it here
mostly as an escape hatch, not because anybody has expressed any
interest in it.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: do not respect diff.noprefix</title>
<updated>2023-03-09T16:32:23Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-03-09T06:11:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c169af8f7ab521cc47b59f104db78847e324a3cb'/>
<id>urn:sha1:c169af8f7ab521cc47b59f104db78847e324a3cb</id>
<content type='text'>
The output of format-patch respects diff.noprefix, but this usually ends
up being a hassle for people receiving the patch, as they have to
manually specify "-p0" in order to apply it.

I don't think there was any specific intention for it to behave this
way. The noprefix option is handled by git_diff_ui_config(), and
format-patch exists in a gray area between plumbing and porcelain.
People do look at the output, and we'd expect it to colorize things,
respect their choice of algorithm, and so on. But this particular option
creates problems for the receiver (in theory so does diff.mnemonicprefix,
but since we are always formatting commits, the mnemonic prefixes will
always be "a/" and "b/").

So let's disable it. The slight downsides are:

  - people who have set diff.noprefix presumably like to see their
    patches without prefixes. If they use format-patch to review their
    series, they'll see prefixes. On the other hand, it is probably a
    good idea for them to look at what will actually get sent out.

    We could try to play games here with "is stdout a tty", as we do for
    color. But that's not a completely reliable signal, and it's
    probably not worth the trouble. If you want to see the patch with
    the usual bells and whistles, then you are better off using "git
    log" or "git show".

  - if a project really does have a workflow that likes prefix-less
    patches, and the receiver is prepared to use "-p0", then the sender
    now has to manually say "--no-prefix" for each format-patch
    invocation. That doesn't seem _too_ terrible given that the receiver
    has to manually say "-p0" for each git-am invocation.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: output header for empty commits</title>
<updated>2023-03-03T17:13:52Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2023-03-03T16:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=94c4289435605a9c39951ccebaf82f131e07c255'/>
<id>urn:sha1:94c4289435605a9c39951ccebaf82f131e07c255</id>
<content type='text'>
When formatting an empty commit, it is surprising that a totally empty
file is generated.  Set the flag to always print the header, matching
the behaviour of git-log.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format.attach: allow empty value to disable multi-part messages</title>
<updated>2023-02-17T23:43:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-17T23:33:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50bebf98d96a6ccf2ca5c76da5dd8afff6933a4c'/>
<id>urn:sha1:50bebf98d96a6ccf2ca5c76da5dd8afff6933a4c</id>
<content type='text'>
When a lower precedence configuration file (e.g. /etc/gitconfig)
defines format.attach in any way, there was no way to disable it in
a more specific configuration file (e.g. $HOME/.gitconfig).

Change the behaviour of setting it to an empty string.  It used to
mean that the result is still a multipart message with only dashes
used as a multi-part separator, but now it resets the setting to
the default (which would be to give an inline patch, unless other
command line options are in effect).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: support format.mboxrd with --stdout</title>
<updated>2022-12-25T07:32:45Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2022-12-22T20:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4810946f6032a973ad752d06a32437bc9bb35e67'/>
<id>urn:sha1:4810946f6032a973ad752d06a32437bc9bb35e67</id>
<content type='text'>
mboxrd is a more robust output format when used with --stdout
and needs more exposure.  Introducing this config knob lets
users choose the more robust format for all their --stdout
uses.

Relying on --pretty=mboxrd and including all of pretty-formats.txt
in the `git format-patch' documentation would likely be
confusing to users.  Furthermore, this setting is useful across
multiple invocations.  So introduce `format.mboxrd' as a boolean
configuration knob that changes the default --pretty=email format
to --pretty=mboxrd when (and only when) --stdout is in use.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
