From: Junio C Hamano Date: Wed, 26 Oct 2022 17:33:39 +0000 (-0700) Subject: CheckPush: workaround early bash 5.2 with buggy command substitution X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9c459704f7210050af582c148b3fc2e99c12c11;p=thirdparty%2Fgit.git CheckPush: workaround early bash 5.2 with buggy command substitution --- diff --git a/CheckPush b/CheckPush index 07decedfc3..61b71d8b99 100755 --- a/CheckPush +++ b/CheckPush @@ -1,11 +1,10 @@ -#!/bin/sh +#!/bin/dash MASTER=master for range in $( - prev_branch= { - git for-each-ref --format='%(refname)' refs/heads/maint-* | + git for-each-ref --format='%(refname)' refs/heads/maint-\* | perl -e ' sub compare_dotted_version { my (@ours) = split(/\./, $_[0]); @@ -32,21 +31,24 @@ for range in $( @maint) { print "$_\n"; } - ' + ' && cat <<-EOF maint $MASTER next EOF } | - while read branch - do - if test -n "$prev_branch" - then - echo "$branch..$prev_branch" - fi - prev_branch=$branch - done + { + prev_branch= + while read branch + do + if test -n "$prev_branch" + then + echo "$branch..$prev_branch" + fi + prev_branch=$branch + done + } ) seen..jch do lg=$(git log --oneline "$range")