Added support for tags

If you are on a commit hash that has a tag, it will display the tag's name instead of the commit hash on the prompt.
master
Jack Sullivan 13 years ago
parent 9bf2a6435a
commit 3cf7fbba8d
  1. 7
      gitstatus.py

@ -40,8 +40,13 @@ else:
remote = '' remote = ''
tag, tag_error = Popen(['git', 'describe', '--exact-match'], stdout=PIPE, stderr=PIPE).communicate()
if not branch: # not on any branch if not branch: # not on any branch
branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1] if tag: # if we are on a tag, print the tag's name
branch = tag
else:
branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
else: else:
remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip() remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip()
if remote_name: if remote_name:

Loading…
Cancel
Save