Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102959961
D27633.id80782.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D27633.id80782.diff
View Options
Index: tools/tools/git/hooks/prepare-commit-msg
===================================================================
--- /dev/null
+++ tools/tools/git/hooks/prepare-commit-msg
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+case "$2" in
+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
+ echo processing >> /tmp/commit-hook.log
+ ;;
+template)
+ return 0
+ ;;
+merge)
+ return 0
+ ;;
+commit)
+ return 0
+ ;;
+esac
+
+outfile=$(mktemp /tmp/freebsd-git-commit.XXXXXXXX)
+cat >$outfile <<EOF
+
+$(awk '1;/^#$/{exit}' $1)
+# Uncomment and complete these metadata fields, as appropriate:
+#
+# PR:
+# Submitted by:
+# Reported by:
+# Reviewed by:
+# Approved by:
+# Obtained from:
+# MFC after:
+# MFH:
+# Relnotes:
+# Security:
+# Sponsored by:
+# Pull Request:
+# Differential Revision:
+#
+# Description of fields to fill in above: 76 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/freebsd/pull/### (*full* GitHub URL needed).
+# Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed).
+$(awk '/^#$/,EOF' $1)
+EOF
+
+mv $outfile $1
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 5:31 AM (2 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14731248
Default Alt Text
D27633.id80782.diff (2 KB)
Attached To
Mode
D27633: Initial version of git commit message preparation hook
Attached
Detach File
Event Timeline
Log In to Comment