diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 9e623371447f..9dcb85cd1a3f 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -1,64 +1,54 @@ #!/bin/sh case "$2" in commit|message) # It appears git invokes this script for interactive rebase but does # not remove commented lines, so just exit if we're not called with the # default (comment-containing) template. egrep -q '^#' "$1" || return 0 ;; template) return 0 ;; merge) return 0 ;; esac outfile=$(mktemp /tmp/freebsd-git-commit.XXXXXXXX) # Create a commit message template from three parts: # # 1. The beginning of the git-provided template (up to the first comment-only # line) which explains commented lines and such. # 2. Our template. # 3. The remainder of the git-provided template (from the first comment-only # line to the end of the file) which lists files staged for commit, files # not staged, and untracked files. cat >$outfile < +# Submitted by: +# Reported by: +# Reviewed by: +# Approved by: +# Obtained from: +# MFC after: +# MFH: +# Relnotes: +# Security: +# Sponsored by: +# Pull Request: /pull/###> +# Differential Revision: # -# Description of fields to fill in above: 72 columns --| -# PR: If and which Problem Report is related. -# Submitted by: If someone else sent in the change. -# Reported by: If someone else reported the issue. -# Reviewed by: If someone else reviewed your modification. -# Approved by: If you needed approval for this commit. -# Obtained from: If the change is from a third party. -# MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. -# MFH: Ports tree branch name. Request approval for merge. -# Relnotes: Set to 'yes' for mention in release notes. -# Security: Vulnerability reference (one per line) or description. -# Sponsored by: If the change was sponsored by an organization. -# Pull Request: https://github.com/freebsd//pull/### (*full* GitHub URL needed). -# Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). +# "Pull Request" and "Differential Revision" require the *full* GitHub or +# Phabricator URL. $(awk '/^#$/,EOF' $1) EOF mv $outfile $1