From 575b3367228a39833f18075d1e695f3f8fc0c1d7 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Mon, 25 Apr 2022 16:00:21 +0200 Subject: [PATCH] make diverged branches force test version --- App/tools/getVersion.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/App/tools/getVersion.pl b/App/tools/getVersion.pl index 49c6fd1..92b435a 100755 --- a/App/tools/getVersion.pl +++ b/App/tools/getVersion.pl @@ -234,13 +234,19 @@ sub parse_git_output { } elsif ($line =~ /(.*[0-9]+[_.][0-9]+([_.][0-9]+)?)-([0-9]+)-g/) { $version = "test"; - say STDERR "tag $1 is $3 commits old => version test"; + my $s = $3 != 1 ? "s" : ""; + say STDERR "tag $1 is $3 commit$s old => version test"; } elsif ($line =~ /Your branch is ahead of '(.*)\/(.*)'/) { say STDERR "branch \"$2\" not yet pushed to remote \"$1\" => version test"; say STDERR "try: git push --tags $1 $2"; $version = "test"; } + elsif ($line =~ /Your branch and '(.*)\/(.*)' have diverged/) { + say STDERR "diverged branch \"$2\" not yet force-pushed to remote \"$1\" => version test"; + say STDERR "try: git push --force --tags $1 $2"; + $version = "test"; + } } }