Newer git version (2.11.0) default to 9 characters for the abbreviated
[arvados-dev.git] / arvados-version-server / arvados-version-server.go
index 2f40df034f71f2f342bd6854ddd3f253e7e8be23..f377979034e34f07bbb8e1dc1794370100ad98ea 100644 (file)
@@ -423,7 +423,7 @@ func versionFromGit(prefix string) (string, error) {
        if err != nil {
                return "", err
        }
-       cmdArgs := []string{"log", "-n1", "--first-parent", "--max-count=1", "--format=format:%h", "."}
+       cmdArgs := []string{"log", "-n1", "--first-parent", "--max-count=1", "--format=format:%h", "--abbrev=9", "."}
        gitHash, err := exec.Command(theConfig.GitExecutablePath, cmdArgs...).Output()
        if err != nil {
                logError([]string{"There was an error running the command ", theConfig.GitExecutablePath, strings.Join(cmdArgs, " "), err.Error()})