From: Sean Whitton Date: Fri, 30 Aug 2024 11:16:03 +0000 (+0100) Subject: git-branchmove: Always pass --no-verify to 'git push' X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=bf527e4fdf35dd5f4996b2b925bf183936183b16;p=chiark-utils.git 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 --- 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