Skip to content

Commit d3432e4

Browse files
authored
Merge pull request #274 from tegonal/bc/grep-P-for-tagFilter
switch to grep -P for tagFilter, allows excluding via negative lookahead
2 parents 3b7dfa0 + b4ee4bc commit d3432e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utility/git-utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ function latestRemoteTag() {
154154
if (($# > 2)); then
155155
logError "Maximum 2 arguments can be passed to latestRemoteTag, given \033[0;36m%s\033[0m\n" "$#"
156156
echo >&2 '1: remote (optional) the name of the remote, defaults to origin'
157-
echo >&2 '2: tagFilter (optional) a regex pattern (as supported by grep -E) which allows to filter available tags before determining the latest, defaults to .* (i.e. include all)'
157+
echo >&2 '2: tagFilter (optional) a regex pattern (as supported by grep -P) which allows to filter available tags before determining the latest, defaults to .* (i.e. include all)'
158158
printStackTrace
159159
exit 9
160160
fi
161161
local -r remote=${1:-"origin"}
162162
local -r tagFilter=${2:-".*"}
163163
local tag
164164
#shellcheck disable=SC2310 # we are aware of that || will disable set -e for remoteTagsSorted
165-
tag=$(remoteTagsSorted "$remote" | grep -E "$tagFilter" | tail -n 1) || die "could not get remote tags sorted for remote %s, see above" "$remote"
165+
tag=$(remoteTagsSorted "$remote" | grep -P "$tagFilter" | tail -n 1) || die "could not get remote tags sorted for remote %s, see above" "$remote"
166166
if [[ -z $tag ]]; then
167167
die "looks like remote \033[0;36m%s\033[0m does not have a tag yet." "$remote"
168168
fi

0 commit comments

Comments
 (0)