summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2021-09-24 14:11:13 -0400
committerThibault Saunier <tsaunier@igalia.com>2021-09-24 17:47:01 -0300
commit3037fde5ebddf3d755d29b4f06f21e6ca122d484 (patch)
treefa88032ccbf34d03c5cbd56b52073cfa6ef9cb8b
parent776d8a661720b05861ab797cca01ef37fdaf6b78 (diff)
Move commit gst-indent hook to the rootmonorepo-start
This renable at meson setup time the installation of the gst-indent commit hook. The hooks were kept from gst-devtools as this set supports both C checks and Python checks. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/904>
-rw-r--r--meson.build3
-rwxr-xr-xscripts/git-hooks/multi-pre-commit.hook (renamed from subprojects/gst-devtools/hooks/multi-pre-commit.hook)2
-rwxr-xr-xscripts/git-hooks/pre-commit-python.hook (renamed from subprojects/gst-devtools/hooks/pre-commit-python.hook)0
-rwxr-xr-xscripts/git-hooks/pre-commit.hook (renamed from subprojects/gst-devtools/hooks/pre-commit.hook)0
-rwxr-xr-xsubprojects/gst-editing-services/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-editing-services/meson.build2
-rwxr-xr-xsubprojects/gst-libav/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-libav/meson.build3
-rwxr-xr-xsubprojects/gst-omx/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-omx/meson.build3
-rwxr-xr-xsubprojects/gst-plugins-bad/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-plugins-bad/meson.build2
-rwxr-xr-xsubprojects/gst-plugins-base/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-plugins-base/meson.build2
-rwxr-xr-xsubprojects/gst-plugins-good/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-plugins-good/meson.build2
-rwxr-xr-xsubprojects/gst-plugins-ugly/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-plugins-ugly/meson.build2
-rwxr-xr-xsubprojects/gst-python/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-python/meson.build2
-rwxr-xr-xsubprojects/gst-rtsp-server/hooks/pre-commit.hook83
-rw-r--r--subprojects/gst-rtsp-server/meson.build3
-rwxr-xr-xsubprojects/gstreamer-vaapi/hooks/pre-commit.hook83
-rw-r--r--subprojects/gstreamer-vaapi/meson.build3
-rwxr-xr-xsubprojects/gstreamer/hooks/pre-commit.hook115
-rw-r--r--subprojects/gstreamer/meson.build1
26 files changed, 4 insertions, 971 deletions
diff --git a/meson.build b/meson.build
index b2709bd91d..dcc1fbae71 100644
--- a/meson.build
+++ b/meson.build
@@ -24,6 +24,9 @@ if cmdres.returncode() != 0
error('Do not run `ninja` or `meson` for gst-build inside the uninstalled environment, you will run into problems')
endif
+# Install gst-indent pre-commit hook
+run_command(python3, '-c', 'import shutil; shutil.copy("scripts/git-hooks/multi-pre-commit.hook", ".git/hooks/pre-commit")')
+
# Ensure that the user does not have Strawberry Perl in PATH, since it ships
# with a pkg-config.bat and broken pkgconfig files for libffi and zlib. Will
# cause a build error, such as in
diff --git a/subprojects/gst-devtools/hooks/multi-pre-commit.hook b/scripts/git-hooks/multi-pre-commit.hook
index 98ae380932..a77d0da21f 100755
--- a/subprojects/gst-devtools/hooks/multi-pre-commit.hook
+++ b/scripts/git-hooks/multi-pre-commit.hook
@@ -15,7 +15,7 @@
# commit. They are executed in the order in which they are listed.
###########################################################
-HOOKS="hooks/pre-commit.hook hooks/pre-commit-python.hook"
+HOOKS="scripts/git-hooks/pre-commit.hook scripts/git-hooks/pre-commit-python.hook"
# exit on error
set -e
diff --git a/subprojects/gst-devtools/hooks/pre-commit-python.hook b/scripts/git-hooks/pre-commit-python.hook
index 14fbc63bfd..14fbc63bfd 100755
--- a/subprojects/gst-devtools/hooks/pre-commit-python.hook
+++ b/scripts/git-hooks/pre-commit-python.hook
diff --git a/subprojects/gst-devtools/hooks/pre-commit.hook b/scripts/git-hooks/pre-commit.hook
index 3c1062b9e0..3c1062b9e0 100755
--- a/subprojects/gst-devtools/hooks/pre-commit.hook
+++ b/scripts/git-hooks/pre-commit.hook
diff --git a/subprojects/gst-editing-services/hooks/pre-commit.hook b/subprojects/gst-editing-services/hooks/pre-commit.hook
deleted file mode 100755
index 3c1062b9e0..0000000000
--- a/subprojects/gst-editing-services/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistant code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-editing-services/meson.build b/subprojects/gst-editing-services/meson.build
index 81fc109d5b..199e8e41e4 100644
--- a/subprojects/gst-editing-services/meson.build
+++ b/subprojects/gst-editing-services/meson.build
@@ -327,5 +327,3 @@ if gio_dep.version().version_compare('< 2.67.4')
endif
configure_file(output: 'config.h', configuration: cdata)
-
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gst-libav/hooks/pre-commit.hook b/subprojects/gst-libav/hooks/pre-commit.hook
deleted file mode 100755
index 3c1062b9e0..0000000000
--- a/subprojects/gst-libav/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistant code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-libav/meson.build b/subprojects/gst-libav/meson.build
index 0abc52824a..2ef892b77c 100644
--- a/subprojects/gst-libav/meson.build
+++ b/subprojects/gst-libav/meson.build
@@ -212,6 +212,3 @@ if gst_version_nano == 0
endif
configure_file(output: 'config.h', configuration: cdata)
-
-python3 = import('python').find_installation()
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gst-omx/hooks/pre-commit.hook b/subprojects/gst-omx/hooks/pre-commit.hook
deleted file mode 100755
index 3c1062b9e0..0000000000
--- a/subprojects/gst-omx/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistant code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-omx/meson.build b/subprojects/gst-omx/meson.build
index d37fc7bd77..37cdecb63f 100644
--- a/subprojects/gst-omx/meson.build
+++ b/subprojects/gst-omx/meson.build
@@ -427,6 +427,3 @@ if gst_version_nano == 0
endif
configure_file(output: 'config.h', configuration: cdata)
-
-python3 = find_program('python3')
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gst-plugins-bad/hooks/pre-commit.hook b/subprojects/gst-plugins-bad/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gst-plugins-bad/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build
index 7cab556e0c..c693ee7b7e 100644
--- a/subprojects/gst-plugins-bad/meson.build
+++ b/subprojects/gst-plugins-bad/meson.build
@@ -543,8 +543,6 @@ endif
configure_file(output : 'config.h', configuration : cdata)
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
-
subdir('docs')
if meson.version().version_compare('>= 0.54')
diff --git a/subprojects/gst-plugins-base/hooks/pre-commit.hook b/subprojects/gst-plugins-base/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gst-plugins-base/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build
index 9b00253a0f..a87b24bfc2 100644
--- a/subprojects/gst-plugins-base/meson.build
+++ b/subprojects/gst-plugins-base/meson.build
@@ -534,8 +534,6 @@ endif
# Use core_conf after all subdirs have set values
configure_file(output : 'config.h', configuration : core_conf)
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
-
if meson.version().version_compare('>= 0.54')
plugin_names = []
foreach plugin: plugins
diff --git a/subprojects/gst-plugins-good/hooks/pre-commit.hook b/subprojects/gst-plugins-good/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gst-plugins-good/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-plugins-good/meson.build b/subprojects/gst-plugins-good/meson.build
index f8e1299333..bc9e53b325 100644
--- a/subprojects/gst-plugins-good/meson.build
+++ b/subprojects/gst-plugins-good/meson.build
@@ -497,8 +497,6 @@ endif
configure_file(output : 'config.h', configuration : cdata)
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
-
if meson.version().version_compare('>= 0.54')
plugin_names = []
foreach plugin: plugins
diff --git a/subprojects/gst-plugins-ugly/hooks/pre-commit.hook b/subprojects/gst-plugins-ugly/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gst-plugins-ugly/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-plugins-ugly/meson.build b/subprojects/gst-plugins-ugly/meson.build
index c5c78fc2bf..f9fff1dff7 100644
--- a/subprojects/gst-plugins-ugly/meson.build
+++ b/subprojects/gst-plugins-ugly/meson.build
@@ -300,8 +300,6 @@ endif
configure_file(output : 'config.h', configuration : cdata)
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
-
if meson.version().version_compare('>= 0.54')
plugin_names = []
foreach plugin: plugins
diff --git a/subprojects/gst-python/hooks/pre-commit.hook b/subprojects/gst-python/hooks/pre-commit.hook
deleted file mode 100755
index 3c1062b9e0..0000000000
--- a/subprojects/gst-python/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistant code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-python/meson.build b/subprojects/gst-python/meson.build
index 483ff6cbea..a1e4c39749 100644
--- a/subprojects/gst-python/meson.build
+++ b/subprojects/gst-python/meson.build
@@ -99,5 +99,3 @@ endif
subdir('gi')
subdir('plugin')
subdir('testsuite')
-
-run_command(python, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gst-rtsp-server/hooks/pre-commit.hook b/subprojects/gst-rtsp-server/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gst-rtsp-server/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build
index 0e55878b33..465011dc20 100644
--- a/subprojects/gst-rtsp-server/meson.build
+++ b/subprojects/gst-rtsp-server/meson.build
@@ -212,6 +212,3 @@ if gst_version_nano == 0
endif
configure_file(output: 'config.h', configuration: cdata)
-
-python3 = import('python').find_installation()
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gstreamer-vaapi/hooks/pre-commit.hook b/subprojects/gstreamer-vaapi/hooks/pre-commit.hook
deleted file mode 100755
index 6f177402b3..0000000000
--- a/subprojects/gstreamer-vaapi/hooks/pre-commit.hook
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistent code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
diff --git a/subprojects/gstreamer-vaapi/meson.build b/subprojects/gstreamer-vaapi/meson.build
index d069f4089c..73fe950c94 100644
--- a/subprojects/gstreamer-vaapi/meson.build
+++ b/subprojects/gstreamer-vaapi/meson.build
@@ -213,6 +213,3 @@ if gmodule_dep.version().version_compare('< 2.67.4')
endif
configure_file(output: 'config.h', configuration: cdata)
-
-python3 = import('python').find_installation()
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/subprojects/gstreamer/hooks/pre-commit.hook b/subprojects/gstreamer/hooks/pre-commit.hook
deleted file mode 100755
index a295d2b42a..0000000000
--- a/subprojects/gstreamer/hooks/pre-commit.hook
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/sh
-#
-# Check that the code follows a consistant code style
-#
-
-# Check for existence of indent, and error out if not present.
-# On some *bsd systems the binary seems to be called gnunindent,
-# so check for that first.
-
-version=`gnuindent --version 2>/dev/null`
-if test "x$version" = "x"; then
- version=`gindent --version 2>/dev/null`
- if test "x$version" = "x"; then
- version=`indent --version 2>/dev/null`
- if test "x$version" = "x"; 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=gindent
- fi
-else
- INDENT=gnuindent
-fi
-
-case `$INDENT --version` in
- GNU*)
- ;;
- default)
- echo "GStreamer git pre-commit hook:"
- echo "Did not find GNU indent, please install it before continuing."
- echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
- exit 1
- ;;
-esac
-
-INDENT_PARAMETERS="--braces-on-if-line \
- --case-brace-indentation0 \
- --case-indentation2 \
- --braces-after-struct-decl-line \
- --line-length80 \
- --no-tabs \
- --cuddle-else \
- --dont-line-up-parentheses \
- --continuation-indentation4 \
- --honour-newlines \
- --tab-size8 \
- --indent-level2 \
- --leave-preprocessor-space"
-
-echo "--Checking style--"
-for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do
- # nf is the temporary checkout. This makes sure we check against the
- # revision in the index (and not the checked out version).
- nf=`git checkout-index --temp ${file} | cut -f 1`
- newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1
- $INDENT ${INDENT_PARAMETERS} \
- $nf -o $newfile 2>> /dev/null
- # FIXME: Call indent twice as it tends to do line-breaks
- # different for every second call.
- $INDENT ${INDENT_PARAMETERS} \
- $newfile 2>> /dev/null
- diff -u -p "${nf}" "${newfile}"
- r=$?
- rm "${newfile}"
- rm "${nf}"
- if [ $r != 0 ] ; then
-echo "================================================================================================="
-echo " Code style error in: $file "
-echo " "
-echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
-echo " If the whole file is to be committed, this should work (run from the top-level directory): "
-echo " "
-echo " gst-indent $file; git add $file; git commit"
-echo " "
-echo "================================================================================================="
- exit 1
- fi
-done
-echo "--Checking style pass--"
-
-# This is an opt-in check, and can only be run from gst-build's devenv,
-# as outside of it MESON_BUILD_ROOT will not be set.
-#
-# The idea is to build the cache, and check if it has unstaged changes.
-# To accomodate for the git add -p case, where the developer will break
-# down a large change set into multiple commits, this hook will only
-# fail when there are no unstaged changes left to commit, in other
-# cases it will only print a reminder that the cache needs committing.
-if [ -v MESON_BUILD_ROOT ] && [ "$GST_CACHE_HOOK" == "enabled" ]; then
- echo "--Checking plugin cache--"
- toplevel=`git rev-parse --show-toplevel`
- repo_name=`basename $toplevel`
- target_name=`ninja -C $MESON_BUILD_ROOT -t targets all | grep "\/\<$repo_name\>\/.*\/gst_plugins_cache.json" | cut -d ":" -f 1`
- ninja -C $MESON_BUILD_ROOT $target_name
- cache_path=`git ls-files $toplevel/**gst_plugins_cache.json`
- git diff --quiet --exit-code -- $cache_path
- has_unstaged_cache_changes=$?
- git diff --quiet --exit-code -- ':!'$cache_path
- has_unstaged_non_cache_changes=$?
-
- if [ $has_unstaged_non_cache_changes != 0 ] ; then
- if [ $has_unstaged_cache_changes != 0 ]; then
- echo -e "\033[1;33mUnstaged cache changes, but working directory isn't clean, don't forget to commit the cache when you're done\033[0m"
- fi
- elif [ $has_unstaged_cache_changes != 0 ]; then
- echo -e "\033[1;31mUnstaged cache changes, but the working directory is clean, you must commit the cache\033[0m"
- exit 1
- else
- echo "--Checking plugin cache pass--"
- fi
-fi
diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
index bed8c4e1aa..e4252b6bb4 100644
--- a/subprojects/gstreamer/meson.build
+++ b/subprojects/gstreamer/meson.build
@@ -618,7 +618,6 @@ if gst_version_nano == 0
endif
configure_file(output : 'config.h', configuration : cdata)
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal'))
if meson.version().version_compare('>= 0.54')