Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175176332
D35042.id105366.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
912 B
Referenced Files
None
Subscribers
None
D35042.id105366.diff
View Options
Index: .hooks/pre-commit.d/check_moved
===================================================================
--- /dev/null
+++ .hooks/pre-commit.d/check_moved
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Check that added MOVED lines follow the proper scheme
+#
+
+moved_changed=$(git diff --name-only --cached --diff-filter=M | grep -E '^MOVED$')
+if [ $? -eq 0 ] ; then
+ # * only check the lines that are added, there should not be an error when fixing broken lines
+ # * each line is checked against
+ # port|new_port?|yyyy-mm-dd|reason
+ broken_lines=$( git diff -U0 --cached MOVED | \
+ grep '^\+[^+]' | \
+ sed 's|^\+\([^+].*$\)|\1|' | \
+ grep -v '^([^\/]+\/[^\/]+)\|([^\/]+\/[^\/]+)?\|([0-9]{4}-[0-9]{2}-[0-9]{2})\|([^\|]+)$')
+ if [ $? -eq 0 ] ; then
+ echo "[pre-commit] ERROR: MOVED lines:"
+ echo "${broken_lines}"
+ echo "is/are invalid -- please run Tools/scripts/MOVEDlint.awk"
+ exit 1
+ fi
+fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 9, 9:33 PM (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40504986
Default Alt Text
D35042.id105366.diff (912 B)
Attached To
Mode
D35042: .hooks: add hook to check validity of new MOVED lines
Attached
Detach File
Event Timeline
Log In to Comment