Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175215700
D35042.id109717.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
789 B
Referenced Files
None
Subscribers
None
D35042.id109717.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 newly added MOVED lines are valid
+#
+
+
+moved_changed=$(git diff --name-only --cached --diff-filter=M | grep -E '^MOVED$')
+if [ $? -eq 0 ] ; then
+ # git changes to root directory of the tree to run hooks
+ tree=$(git rev-parse --show-toplevel)
+ # check the last seven days
+ lastdate=$(date -v-7d "+%Y-%m-%d")
+
+ errors=$(PORTSDIR=${tree} Tools/scripts/MOVEDlint.awk -v lastdate="${lastdate}")
+ if [ $? -ne 0 ] ; then
+ echo -e "[pre-commit] ERROR: MOVED contains errors.\n" \
+ " Please apply the suggested changes:\n"
+ echo "${errors}"
+ exit 1
+ fi
+fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 10, 4:21 AM (8 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40524134
Default Alt Text
D35042.id109717.diff (789 B)
Attached To
Mode
D35042: .hooks: add hook to check validity of new MOVED lines
Attached
Detach File
Event Timeline
Log In to Comment