1 which_scm(1ONBLD) illumos Build Tools which_scm(1ONBLD) 2 3 4 5 NAME 6 which_scm - Report Source Code Management system 7 8 SYNOPSIS 9 which_scm 10 11 12 DESCRIPTION 13 which_scm detects the Source Code Management (SCM) system in use, and 14 prints a single line of text containing a one-word name for the SCM, 15 followed by a space, and then the top-level directory path for the 16 workspace. 17 18 The typical usage within a ksh script is: 19 which_scm | read SCM_TYPE CODEMGR_WS || exit 1 20 21 If CODEMGR_WS is set in the environment, then which_scm checks only 22 that directory, assuming that it is the top of the tree. 23 24 If CODEMGR_WS is not set, then which_scm searches upwards to find the 25 containing workspace path, and reports that path. 26 27 which_scm can detect the following types of SCM systems (these are the 28 keywords used in the output format): 29 cvs 30 git 31 mercurial 32 rcs 33 sccs 34 subversion 35 teamware 36 37 If the type of SCM in use is not known, then the string "unknown" is 38 printed, and the path returned is $CODEMGR_WS (if set) or the current 39 working directory. The command may exit with an error if the SCM could 40 be detected, but is unusable. 41 42 43 ENVIRONMENT VARIABLES 44 The following environment variable is used by which_scm: 45 46 47 CODEMGR_WS path to current workspace. 48 49 50 SEE ALSO 51 cvs(1), git(1), hg(1), sccs(1) svn(1), workspace(1) 52 53 54 55 18 September 2009 which_scm(1ONBLD)