From b850a658edb9d301502a90bc360716dda5d77f33 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 12 Apr 2024 23:08:16 +0300 Subject: [PATCH] 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: --- scripts/git-hooks/pre-commit.hook | 24 +++++++++++++++--------- scripts/gst-indent | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/git-hooks/pre-commit.hook b/scripts/git-hooks/pre-commit.hook index d5d7ba2eba..098b2a62f1 100755 --- a/scripts/git-hooks/pre-commit.hook +++ b/scripts/git-hooks/pre-commit.hook @@ -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 diff --git a/scripts/gst-indent b/scripts/gst-indent index a9b8bfe430..50ec6181f5 100755 --- a/scripts/gst-indent +++ b/scripts/gst-indent @@ -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