Print this page
Add git support to which_scm utility


  34 detects the Source Code Management (SCM) system in use, and prints a
  35 single line of text containing a one-word name for the SCM, followed
  36 by a space, and then the top-level directory path for the workspace.
  37 
  38 The typical usage within a ksh script is:
  39 .nf
  40         which_scm | read SCM_TYPE CODEMGR_WS || exit 1
  41 .fi
  42 
  43 If CODEMGR_WS is set in the environment, then \fBwhich_scm\fR
  44 checks only that directory, assuming that it is the top of the tree.
  45 
  46 If CODEMGR_WS is not set, then \fBwhich_scm\fR searches upwards to
  47 find the containing workspace path, and reports that path.
  48 
  49 .B which_scm
  50 can detect the following types of SCM systems (these are the keywords
  51 used in the output format):
  52 .nf
  53         cvs

  54         mercurial
  55         rcs
  56         sccs
  57         subversion
  58         teamware
  59 .fi
  60 
  61 If the type of SCM in use is not known, then the string "unknown" is
  62 printed, and the path returned is $CODEMGR_WS (if set) or the current
  63 working directory.  The command may exit with an error if the SCM
  64 could be detected, but is unusable.
  65 
  66 .SH ENVIRONMENT VARIABLES
  67 The following environment variable is used by \fBwhich_scm\fR:
  68 
  69 .PP
  70 \fBCODEMGR_WS\fR path to current workspace.
  71 
  72 .SH SEE ALSO
  73 .IR cvs(1) ,
  74 .IR hg(1) ,

  75 .IR sccs(1)
  76 .IR svn(1) ,
  77 .IR workspace(1)


  34 detects the Source Code Management (SCM) system in use, and prints a
  35 single line of text containing a one-word name for the SCM, followed
  36 by a space, and then the top-level directory path for the workspace.
  37 
  38 The typical usage within a ksh script is:
  39 .nf
  40         which_scm | read SCM_TYPE CODEMGR_WS || exit 1
  41 .fi
  42 
  43 If CODEMGR_WS is set in the environment, then \fBwhich_scm\fR
  44 checks only that directory, assuming that it is the top of the tree.
  45 
  46 If CODEMGR_WS is not set, then \fBwhich_scm\fR searches upwards to
  47 find the containing workspace path, and reports that path.
  48 
  49 .B which_scm
  50 can detect the following types of SCM systems (these are the keywords
  51 used in the output format):
  52 .nf
  53         cvs
  54         git
  55         mercurial
  56         rcs
  57         sccs
  58         subversion
  59         teamware
  60 .fi
  61 
  62 If the type of SCM in use is not known, then the string "unknown" is
  63 printed, and the path returned is $CODEMGR_WS (if set) or the current
  64 working directory.  The command may exit with an error if the SCM
  65 could be detected, but is unusable.
  66 
  67 .SH ENVIRONMENT VARIABLES
  68 The following environment variable is used by \fBwhich_scm\fR:
  69 
  70 .PP
  71 \fBCODEMGR_WS\fR path to current workspace.
  72 
  73 .SH SEE ALSO
  74 .IR cvs(1) ,
  75 .IR hg(1) ,
  76 .IR git(1) ,
  77 .IR sccs(1)
  78 .IR svn(1) ,
  79 .IR workspace(1)