From bf527e4fdf35dd5f4996b2b925bf183936183b16 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 30 Aug 2024 12:16:03 +0100 Subject: [PATCH] git-branchmove: Always pass --no-verify to 'git push' We are not doing the kind of push for which git pre-push hooks are written, so they will often fail. In particular, 'git branchmove' is primarily intended for moving WIP branches around, whereas pre-push hooks are usually for the purpose of preventing accidental pushes of unpolished work to public branches. With this in mind, I think we should try passing --no-verify unconditionally, instead of providing an option. Signed-off-by: Sean Whitton --- scripts/git-branchmove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/git-branchmove b/scripts/git-branchmove index 156078f..270d78a 100755 --- a/scripts/git-branchmove +++ b/scripts/git-branchmove @@ -187,13 +187,13 @@ foreach my $source_branch (@source_branches) { my @refspecs = map { "$_->{ref}:$_->{ref}" } @source_branches; my @nuke_refspecs = map { ":$_->{ref}" } @source_branches; if ($op eq 'put') { - $git->push('--no-follow-tags', $remote, @refspecs); + $git->push(qw(--no-follow-tags --no-verify), $remote, @refspecs); $git->update_ref('-m', "git-branchmove: moved to $remote ($rurl)", '-d', $_->{ref}, $_->{hash}) for @source_branches; } elsif ($op eq 'get') { $git->fetch('--no-tags', $remote, @refspecs); - $git->push('--no-follow-tags', $remote, @nuke_refspecs); + $git->push(qw(--no-follow-tags --no-verify), $remote, @nuke_refspecs); } # if the remote is a named remote, rather than just a URI, update -- 2.30.2