diff --git a/documentation/content/en/articles/committers-guide/_index.adoc b/documentation/content/en/articles/committers-guide/_index.adoc --- a/documentation/content/en/articles/committers-guide/_index.adoc +++ b/documentation/content/en/articles/committers-guide/_index.adoc @@ -527,8 +527,44 @@ ===== Commit message formats +Git commits are displayed in many formats, by many different tools. +Because of the history of git itself -- which was strongly email-oriented -- git commits look a *tiny* bit like email messages: + +.... + + + +.... + +Many tools will show the first line as the summary of the commit. + +The FreeBSD ports tree contains about 140 thousand files, spread over about 30 thousand different ports. +In order for someone glancing at commits, for example, by looking at the output of `git log --oneline`, https://lists.freebsd.org/pipermail/dev-commits-ports-all/2021-June/subject.html[their ports commit mailbox], or using a web interface like https://github.com/freebsd/freebsd-ports/commits/main[GitHub] or https://cgit.freebsd.org/ports/log/[FreeBSD's cgit], to have an easier expercience at finding what they are looking for, or to simply have an idea of what is happening, the use of a subject *discriminator* became necessary. +(For example see what https://cgit.freebsd.org/ports/log/?id=28d644425993af93d955ab54e90d05c7a30476d1[commit subject from 2010] look like now.) + +Since ports commits are *generally* concerned with one single port, their subject usually start with "```/:```", for example: + +.... +/: + + +.... + +This usage actually emerged long before the Ports tree switched to Git. + +Of course, the discriminator is not limited to "```/:```". +When the commit touches more than one port, or when it touch other parts of the tree, use whatever discriminator feels better, for example, when touching a single file, you can use "```MOVED:```" or "```Mk/Uses/python.mk:```". +When touching multiple port as part of a sweep, you can use "```KDE:```", "```Gnome:```", "```expire:```" or "```cleanup:```". +If nothing comes to mind you can even use "```*:```", but try not to abuse it. + +====== Git Hook + A hook is available in the ports repository to help you write up your commit messages in https://cgit.freebsd.org/ports/tree/.hooks/prepare-commit-msg[.hooks/prepare-commit-message]. -It can be enabled by running ``git config --add core.hooksPath .hooks``. +It can be enabled by running: + +.... +git config --add core.hooksPath .hooks +.... The main point being that a commit message should be formatted in the following way: