aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp4
-rw-r--r--src/src.pro8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1cabbad..e6a2bfa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -117,6 +117,10 @@ int main(int argc, char **argv)
CommandLineParser::addOptionDefinitions(options);
Stats::init();
CommandLineParser *args = CommandLineParser::instance();
+ if(args->contains(QLatin1String("version"))) {
+ printf("Git version: %s\n", VER);
+ return 0;
+ }
if (args->contains(QLatin1String("help")) || args->arguments().count() != 1) {
args->usage(QString(), "[Path to subversion repo]");
return 0;
diff --git a/src/src.pro b/src/src.pro
index 2626a6f..da6d40d 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -6,6 +6,14 @@ SVN_INCLUDE = /usr/include/subversion-1 /usr/local/include/subversion-1
APR_INCLUDE = /usr/include/apr-1.0 /usr/include/apr-1 /usr/local/include/apr-1
exists(local-config.pri):include(local-config.pri)
+VERSION = $$system(git --no-pager show --pretty=oneline --no-notes | head -1 | cut -b-40)
+ !isEmpty(VERSION){
+ VERSION = $${VERSION}
+ }
+
+VERSTR = '\\"$${VERSION}\\"' # place quotes around the version string
+DEFINES += VER=\"$${VERSTR}\" # create a VER macro containing the version string
+
TEMPLATE = app
TARGET = ../svn-all-fast-export
DEPENDPATH += .