swh:1:snp:c3bf2749e3476071fa748f67b0ffa2fdc5fe49d9
Raw File
Tip revision: 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 authored by Linus Torvalds on 25 March 2018, 22:44:30 UTC
Linux 4.16-rc7
Tip revision: 3eb2ce8
documentation-file-ref-check
#!/bin/sh
# Treewide grep for references to files under Documentation, and report
# non-existing files in stderr.

for f in $(git ls-files); do
	for ref in $(grep -ho "Documentation/[A-Za-z0-9_.,~/*+-]*" "$f"); do
		# presume trailing . and , are not part of the name
		ref=${ref%%[.,]}

		# use ls to handle wildcards
		if ! ls $ref >/dev/null 2>&1; then
			echo "$f: $ref" >&2
		fi
	done
done
back to top