On Wed, Aug 16, 2023 at 12:22:33PM +0100, Simon McVittie wrote:
> I personally think the extent to which git has "won", both upstream and in
> Debian package maintenance, means that the Patch Tagging Guidelines should
> be encouraging the git-like style as primary, with From/Date/Subject
> in a header and all Debian-specific fields in a trailing pseudo-header,
> the same layout that's familiar for Signed-off-by and similar tags used
> by many upstream developers:
> 
>     From <anything here, optional, ignored>
>     From: ...
>     Date: ...
>     Subject: <short description>
> 
>     <long description>
> 
>     <more long description>
> 
>     Signed-off-by: ...
>     Bug: https://...
>     Origin: vendor, Debian
>     Forwarded: https://...
>     ---
>     <the actual diff>

While I completely agree with everything that you've said, I will
additionally point out that a notable use of patches is backporting
upstream fixes to older package releases.

In that context, it's generally useful (best practice?) to call 'git
cherry-pick -x' on the upstream commit, which will result in git
generating a line like

  (cherry-picked from commit ...)

In that case, the patch metadata should IMO go *after* that line,
leaving the upstream commit message completely unchanged. See [1] for
an example of how that looks like in practice.

Incidentally, notice how I've had to include

  Forwarded: not-needed
  Origin: https://gitlab.com/libvirt/libvirt/-/commit/...

in order for tracker.d.o not to report this backport as a patch that
needs forwarding upstream. I feel that the presence of a
"(cherry-picked from commit ...)" line should imply at least the
first bit, but maybe there are scenarios that I haven't considered
and that make being explicit about it a necessity.


[1] 
https://salsa.debian.org/libvirt-team/libvirt/-/blob/26c4e495779fc9e7649956983818735bbc7300fd/debian/patches/backport/src-fix-max-file-limits-in-systemd-services.patch
-- 
Andrea Bolognani <e...@kiyuko.org>
Resistance is futile, you will be garbage collected.

Attachment: signature.asc
Description: PGP signature

Reply via email to