diff --git a/scripts/git-hooks/multi-pre-commit.hook b/scripts/git-hooks/multi-pre-commit.hook index a77d0da21f..a5ccf1fd27 100755 --- a/scripts/git-hooks/multi-pre-commit.hook +++ b/scripts/git-hooks/multi-pre-commit.hook @@ -20,6 +20,12 @@ HOOKS="scripts/git-hooks/pre-commit.hook scripts/git-hooks/pre-commit-python.hoo # exit on error set -e +if [ "$GST_DISABLE_PRE_COMMIT_HOOKS" = "1" ] +then + echo "Pre-commits hooks disabled by env GST_DISABLE_PRE_COMMIT_HOOKS." + exit 0 +fi + echo $PWD for hook in $HOOKS diff --git a/scripts/move_mrs_to_monorepo.py b/scripts/move_mrs_to_monorepo.py index bd1ed8e631..379f672a85 100755 --- a/scripts/move_mrs_to_monorepo.py +++ b/scripts/move_mrs_to_monorepo.py @@ -334,6 +334,11 @@ class GstMRMover: self.gl = self.connect() self.gl.auth() + # Skip pre-commit hooks when migrating. Some users may have a + # different version of gnu indent and that can lead to cherry-pick + # failing. + os.environ["GST_DISABLE_PRE_COMMIT_HOOKS"] = "1" + try: prevbranch = self.git( "rev-parse", "--abbrev-ref", "HEAD", can_fail=True).strip()