pre-commit: Update the indent hook to work with our fork

We now have gst-indent-1.0 [1] which is a stripped down
fork of the version we expect. It's also using meson,
which is a bonus.

[1] https://gitlab.freedesktop.org/gstreamer/gst-indent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6624>
This commit is contained in:
Jordan Petridis 2024-04-12 23:08:16 +03:00 committed by GStreamer Marge Bot
parent 9156b373e6
commit b850a658ed
2 changed files with 16 additions and 10 deletions

View file

@ -7,23 +7,29 @@
# On some *bsd systems the binary seems to be called gnunindent,
# so check for that first.
version=$(gnuindent --version 2>/dev/null)
version=$(gst-indent-1.0 --version 2>/dev/null)
if test -z "$version"; then
version=$(gindent --version 2>/dev/null)
version=$(gnuindent --version 2>/dev/null)
if test -z "$version"; then
version=$(indent --version 2>/dev/null)
version=$(gindent --version 2>/dev/null)
if test -z "$version"; then
echo "GStreamer git pre-commit hook:"
echo "Did not find GNU indent, please install it before continuing."
exit 1
version=$(indent --version 2>/dev/null)
if test -z "$version"; then
echo "GStreamer git pre-commit hook:"
echo "Did not find GNU indent, please install it before continuing."
exit 1
else
INDENT=indent
fi
else
INDENT=indent
INDENT=gindent
fi
else
INDENT=gindent
INDENT=gnuindent
fi
else
INDENT=gnuindent
INDENT=gst-indent-1.o
fi
case $($INDENT --version) in

View file

@ -1,6 +1,6 @@
#!/bin/sh
for execname in gnuindent gindent indent; do
for execname in gst-indent-1.0 gnuindent gindent indent; do
version=`$execname --version 2>/dev/null`
if test "x$version" != "x"; then
INDENT=$execname