summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2021-10-01 15:49:12 -0400
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-10-04 12:56:47 +0000
commitf54c2a2bac7931fd72e629a56bfad0e6869d0251 (patch)
treee6a8984ec908528eeae5e60d6bbef9cda7b45bdc /scripts
parent3d25ff10a990e8269691d64ae0e530f401088759 (diff)
downloadgstreamer-f54c2a2bac7931fd72e629a56bfad0e6869d0251.tar.gz
move_mrs: Disable our commit hook during the move
As GNU indent version can be different on the user system, we see some differences during migration thas causes conflicts. Making cherry-pick difficults to recover without breaking the style temporily. Note that cherry-pick continuation does not allow passing the -n option to skip the hooks. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1017>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/git-hooks/multi-pre-commit.hook6
-rwxr-xr-xscripts/move_mrs_to_monorepo.py5
2 files changed, 11 insertions, 0 deletions
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()