mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Merge r7352 from trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
54
scripts/list-non-source-files
Executable file
54
scripts/list-non-source-files
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
prefix_matches() {
|
||||
local f
|
||||
|
||||
f="$1"
|
||||
shift
|
||||
for s in "$@"; do
|
||||
if [ "$f" = "$s" ] || [ "${f#s/}" != "$f" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
for d in "${@-.}"; do
|
||||
(
|
||||
cd "$d" &&
|
||||
if [ -e .svn ]; then
|
||||
svn status --no-ignore |
|
||||
grep '^[I?] ' |
|
||||
cut -c8-
|
||||
elif git branch >&/dev/null; then
|
||||
exec 3< <(find . -type f | cut -c3- | grep -v '^\.git/' | sort)
|
||||
git ls-tree -r HEAD | cut -f2 -d' ' | sort |
|
||||
while read -r f; do
|
||||
while { read -r g; } <&3 && [ "$g" '<' "$f" ]; do echo "$g"; done
|
||||
done
|
||||
while { read -r g; } <&3; do echo "$g"; done
|
||||
exec 3<&-
|
||||
elif hg branch >&/dev/null; then
|
||||
subrepos=$(if [ -e .hgsub ]; then sed 's/ = .*//' .hgsub; fi)""
|
||||
exec 3< <(find . -type f | cut -c3- | grep -Ev '^$|^\.hg/' | sort)
|
||||
hg locate |
|
||||
sort |
|
||||
while read -r f; do
|
||||
while { read -r g; } <&3 && [ "$g" '<' "$f" ]; do
|
||||
if ! prefix_matches "$g" "$subrepos"; then
|
||||
echo "$g"
|
||||
fi
|
||||
done
|
||||
done
|
||||
while { read -r g; } <&3; do echo "$g"; done
|
||||
exec 3<&-
|
||||
for s in $subrepos; do
|
||||
$0 "$s"
|
||||
done
|
||||
else
|
||||
echo "Ignored directory $PWD"
|
||||
fi
|
||||
)
|
||||
done
|
||||
Reference in New Issue
Block a user