From b7ca7db53e6e33c22b4139f96238639d89aadd1e Mon Sep 17 00:00:00 2001 From: Nathan Ho Date: Sun, 11 Dec 2016 12:31:34 -0800 Subject: [PATCH] scsynth: /version branch name & commit hash --- HelpSource/Reference/Server-Command-Reference.schelp | 4 ++++ server/scsynth/SC_MiscCmds.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HelpSource/Reference/Server-Command-Reference.schelp b/HelpSource/Reference/Server-Command-Reference.schelp index f1084b4c210..affee11c9a1 100644 --- a/HelpSource/Reference/Server-Command-Reference.schelp +++ b/HelpSource/Reference/Server-Command-Reference.schelp @@ -124,11 +124,15 @@ definitionlist:: ## int || Major version number. Equivalent to sclang's code::Main.scVersionMajor::. ## int || Minor version number. Equivalent to sclang's code::Main.scVersionMinor::. ## string || Patch version name. Equivalent to sclang's code::Main.scVersionPostfix::. +## string || Git branch name. +## string || First seven hex digits of the commit hash. :: :: The standard human-readable version string can be constructed by concatenating code:: major_version ++ "." ++ minor_version ++ patch_version ::. Since version information is easily accessible to sclang users via the methods described above, this command is mostly useful for alternate clients. +The git branch name and commit hash could be anything if the user has forked SC, so they should only be used for display and user interface purposes. + section:: Synth Definition Commands subsection:: /d_recv diff --git a/server/scsynth/SC_MiscCmds.cpp b/server/scsynth/SC_MiscCmds.cpp index 2a44cabdf2f..066313afb13 100644 --- a/server/scsynth/SC_MiscCmds.cpp +++ b/server/scsynth/SC_MiscCmds.cpp @@ -1334,7 +1334,7 @@ SCErr meth_version(World *inWorld, int inSize, char *inData, ReplyAddress* inRep small_scpacket packet; packet.adds("/version.reply"); - packet.maketags(5); + packet.maketags(7); packet.addtag(','); packet.addtag('s'); packet.adds("scsynth"); @@ -1344,6 +1344,10 @@ SCErr meth_version(World *inWorld, int inSize, char *inData, ReplyAddress* inRep packet.addi(SC_VersionMinor); packet.addtag('s'); packet.adds(SC_VersionPatch); + packet.addtag('s'); + packet.adds(SC_Branch); + packet.addtag('s'); + packet.adds(SC_CommitHash); CallSequencedCommand(SendReplyCmd, inWorld, packet.size(), packet.data(), inReply);