mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org
Cc: Alejandro Colomar <alx@kernel.org>,
	linux-kernel@vger.kernel.org,  Alyssa Ross <hi@alyssa.is>,
	Greg KH <greg@kroah.com>
Subject: [PATCH] CONTRIBUTING.d/: Document format of 'Fixes:' trailer fields
Date: Tue, 3 Feb 2026 21:25:53 +0100	[thread overview]
Message-ID: <3a656e90329f26d743d0904f56ae847951c852c7.1770150003.git.alx@kernel.org> (raw)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---

Hi!

I hadn't yet documented how to produce the Fixes: trailer fields in the
Linux man-pages project.  We require the commit-date to disambiguate
possible hash (and subject) collisions.  This documents how to produce
them easily.

I hope this will be useful to other projects.  I've been using this
format for some time, and it has some nice properties: it shows at first
glance the date of a commit (which itself gives an idea of how many
stable versions would need to be fixed).  It can also be parsed by a
machine, by having a consistent and simple (unambiguous) format.


Have a lovely night!
Alex

 CONTRIBUTING.d/git                 | 16 ++++++++++++++++
 CONTRIBUTING.d/patches/description | 11 +++++++++++
 2 files changed, 27 insertions(+)

diff --git a/CONTRIBUTING.d/git b/CONTRIBUTING.d/git
index 4b7a95472..3f944a23c 100644
--- a/CONTRIBUTING.d/git
+++ b/CONTRIBUTING.d/git
@@ -43,6 +43,22 @@ Description
 		$ git config --global \
 			sendemail.sendmailcmd 'mutt -H - && true';
 
+    Commit references
+	'Fixes:' trailer fields should have the following format.
+
+		Fixes: 12-char-hash ([author-date,] commit-date; "subject")
+
+	where the author date is optional, and only included if it's
+	somehow important.  The commit date is often more important, as
+	it's sorted, and thus can be used to find (with a binary search)
+	a commit whose hash and subject may have collisions.  To produce
+	such fields, the following git aliases are useful.
+
+		$ git config --global alias.ref \
+			"show --no-patch --abbrev=12 --date=short --format=tformat:'%C(auto)%h%C(reset) %C(dim white)(%cd%x3B \"%C(reset)%C(auto)%s%C(reset)%C(dim white)\")%C(reset)'"
+		$ git config --global alias.ref2 \
+			"show --no-patch --abbrev=12 --date=short --format=tformat:'%C(auto)%h%C(reset) %C(dim white)(%ad, %cd%x3B \"%C(reset)%C(auto)%s%C(reset)%C(dim white)\")%C(reset)'"
+
 See also
 	git-config(1)
 	git-diff(1)
diff --git a/CONTRIBUTING.d/patches/description b/CONTRIBUTING.d/patches/description
index 73b603bf3..09ee35ec8 100644
--- a/CONTRIBUTING.d/patches/description
+++ b/CONTRIBUTING.d/patches/description
@@ -55,3 +55,14 @@ Description
 	"Co-developed-by:".  Example:
 
 		Signed-off-by: Alejandro Colomar <alx@kernel.org>
+
+	Add 'Fixes:' tags as necessary.  See <CONTRIBUTING.d/git> for
+	how to configure the alias.ref and alias.ref2 git aliases.  The
+	commit references can be produced with them.
+
+		$ git ref bb509e6fc
+		bb509e6fcbae (2020-10-16; "kernel_lockdown.7: New page documenting the Kernel Lockdown feature")
+
+	which then can be used as
+
+		Fixes: bb509e6fcbae (2020-10-16; "kernel_lockdown.7: New page documenting the Kernel Lockdown feature")

Range-diff:
-:  --------- > 1:  3a656e903 CONTRIBUTING.d/: Document format of 'Fixes:' trailer fields

base-commit: be29e611a386b754fd5ce9f9d1ef421d15319ec1
-- 
2.51.0


             reply	other threads:[~2026-02-03 20:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 20:25 Alejandro Colomar [this message]
2026-02-04  0:01 ` Collin Funk
2026-02-04 13:33   ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a656e90329f26d743d0904f56ae847951c852c7.1770150003.git.alx@kernel.org \
    --to=alx@kernel.org \
    --cc=greg@kroah.com \
    --cc=hi@alyssa.is \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®