Commit 4171d1f5 authored by Tomasz Kulasek's avatar Tomasz Kulasek Committed by Ben Walker
Browse files

scripts/check_format: fix unsupported git pathspec magic exclude



Pathspec magic exclude is unsupported in git <1.9.5.

Change-Id: Ibba4e6d6f0fa34ce766a42af0cd32a1dc3d16716
Signed-off-by: default avatarTomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460973


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 14034200
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ function nproc() {

fi

function version_lt() {
	[ $( echo -e "$1\n$2" | sort -V | head -1 ) != "$1" ]
}

rc=0

echo -n "Checking file permissions..."
@@ -92,6 +96,14 @@ else
	echo "You do not have astyle installed so your code style is not being checked!"
fi

GIT_VERSION=$( git --version | cut -d' ' -f3 )

if version_lt "1.9.5" "${GIT_VERSION}"; then
	# git <1.9.5 doesn't support pathspec magic exclude
	echo " Your git version is too old to perform all tests. Please update git to at least 1.9.5 version..."
	exit 0
fi

echo -n "Checking comment style..."

git grep --line-number -e '/[*][^ *-]' -- '*.[ch]' > comment.log || true