From e630ec421c60baf73791a5891ef7f699bebe8dee Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 20 Oct 2015 16:18:53 +0200 Subject: [PATCH] some more checks --- App/tools/getVersion.tcl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/App/tools/getVersion.tcl b/App/tools/getVersion.tcl index 640e178..7678483 100755 --- a/App/tools/getVersion.tcl +++ b/App/tools/getVersion.tcl @@ -150,6 +150,13 @@ scanmatch $git_context {^A .*} { continue } +scanmatch $git_context {^AM .*} { + set file [lindex $matchInfo(line) 1] + puts stderr "$file: locally added and modified => version test" + set version test + continue +} + scanmatch $git_context {^([ MADRCU][ MADRCU]) .*} { set file [lindex $matchInfo(line) 1] puts stderr "$file: $matchInfo(submatch0) (whatever that means) => version test" @@ -162,7 +169,7 @@ scanmatch $git_context {fatal: No names found} { set version test } -scanmatch $git_context {([0-9]+)\.([0-9]+)(\.([0-9]+))?$} { +scanmatch $git_context {^([0-9]+)\.([0-9]+)(\.([0-9]+))?$} { set major $matchInfo(submatch0) set minor $matchInfo(submatch1) set patch [expr $matchInfo(submatch3) + 0] @@ -170,7 +177,7 @@ scanmatch $git_context {([0-9]+)\.([0-9]+)(\.([0-9]+))?$} { puts stderr "checking tag $matchInfo(line) => version $version" } -scanmatch $git_context {_([0-9]+)_([0-9]+)(_([0-9]+))?$} { +scanmatch $git_context {^[a-zA-Z0-9]+_([0-9]+)_([0-9]+)(_([0-9]+))?$} { set major $matchInfo(submatch0) set minor $matchInfo(submatch1) set patch [expr $matchInfo(submatch3) + 0] @@ -183,6 +190,12 @@ scanmatch $git_context {(.*[0-9]+[_.][0-9]+([_.][0-9]+)?)-([0-9]+)-g} { puts stderr "tag $matchInfo(submatch0) is $matchInfo(submatch2) commits old => version test" } +scanmatch $git_context {Your branch is ahead of '(.*)/(.*)'} { + puts stderr "not pushed to server => version test" + puts stderr "try: git push --tags $matchInfo(submatch0) $matchInfo(submatch1)" + set version test +} + if {[lindex $argv 0] == "-d"} { set debug 1 set argv [lrange $argv 1 end] @@ -217,6 +230,13 @@ if {[catch { puts stderr "Could not find out version tag => version test" set version test } + + if {$version != "test"} { + set statusinfo [open "|git status 2>@ stdout"] + scanfile $git_context $statusinfo + catch {close $statusinfo} + } + puts $version exit }] && $debug} { puts stderr "git: $errorInfo" }