old_contents: from subprocess import check_output
  
  from django import template
  
  register = template.Library()
  
  
  @register.simple_tag
  def git_revno():
      return check_output(['git', 'rev-parse', '--verify', 'HEAD']).strip()[-7:]
  
new_contents: from subprocess import (
      PIPE,
      Popen,
  )
  
  from django import template
  from django.conf import settings
  
  register = template.Library()
  
  
  @register.simple_tag
  def git_revno():
      p = Popen(['git', 'rev-parse', '--verify', 'HEAD'], stdout=PIPE,
                cwd=settings.BASE_DIR)
      out, _ = p.communicate()
      return out.strip()[-7:]
  
subject: Fix git-revno to always run in one dir