docs: def _gitinfo():
      ''' returns a string containing git branch, commit id and commit date '''
      result = None
      repo_path = os.path.join(os.path.dirname(__file__), '..', '..', '..', '.git')
  
      if os.path.exists(repo_path):
          # Check if the .git is a file. If it is a file, it means that we are in a submodule structure.
          if os.path.isfile(repo_path):
              try:
                  gitdir = yaml.load(open(repo_path)).get('gitdir')
                  # There is a posibility the .git file to have an absolute path.
                  if os.path.isabs(gitdir):
                      repo_path = gitdir
                  else:
                      repo_path = os.path.join(repo_path.split('.git')[0], gitdir)
              except (IOError, AttributeError):
                  return ''
          f = open(os.path.join(repo_path, "HEAD"))
          branch = f.readline().split('/')[-1].rstrip("\n")
          f.close()
          branch_path = os.path.join(repo_path, "refs", "heads", branch)
          if os.path.exists(branch_path):
              f = open(branch_path)
              commit = f.readline()[:10]
              f.close()
              date = time.localtime(os.stat(branch_path).st_mtime)
              if time.daylight == 0:
                  offset = time.timezone
              else:
                  offset = time.altzone
              result = "({0} {1}) last updated {2} (GMT {3:+04d})".format(branch, commit,
                  time.strftime("%Y/%m/%d %H:%M:%S", date), offset / -36)
      else:
          result = ''
      return result