def _getGitShaString(dist=None, sha=None):
 shaStr = 'n/a'
 if (dist is not None):
  proc = subprocess.Popen('git rev-parse --short HEAD', stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd='.', shell=True)
  (repo_commit, _) = proc.communicate()
  del proc
  if repo_commit:
   shaStr = repo_commit.strip()
  else:
   shaStr = 'n/a'
 return shaStr

def _getGitShaString ( dist = None , sha = None ) : shaStr = 'n/a' if ( dist is not None ) : proc = subprocess . Popen ( 'git rev-parse --short HEAD' , stdout = subprocess . PIPE , stderr = subprocess . PIPE , cwd = '.' , shell = True ) ( repo_commit , _ ) = proc . communicate ( ) del proc if repo_commit : shaStr = repo_commit . strip ( ) else : shaStr = 'n/a' return shaStr
if generic==true then returns empty __git_sha__ string .