code: def git_suffix(fname):
      
      # we assume that the .git folder is two levels above any package
      # i.e. openquake/engine/../../.git
      git_path = os.path.join(os.path.dirname(fname), '..', '..', '.git')
  
      # macOS complains if we try to execute git and it's not available.
      # Code will run, but a pop-up offering to install bloatware (Xcode)
      # is raised. This is annoying in end-users installations, so we check
      # if .git exists before trying to execute the git executable
      if os.path.isdir(git_path):
          try:
              gh = subprocess.check_output(
                  ['git', 'rev-parse', '--short', 'HEAD'],
                  stderr=open(os.devnull, 'w'),
                  cwd=os.path.dirname(git_path)).strip()
              gh = "-git" + decode(gh) if gh else ''
              return gh
          except Exception:
              # trapping everything on purpose; git may not be installed or it
              # may not work properly
              pass
  
      return ''
docs: :returns: `<short git hash>` if Git repository found