Hannes Kath commited on
Commit
2cd7ddb
·
1 Parent(s): 5a88416
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -1,5 +1,25 @@
 
 
 
1
 
2
 
3
 
4
  if __name__ == '__main__':
5
- print('Hi')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ from git import Repo
4
 
5
 
6
 
7
  if __name__ == '__main__':
8
+ print('Hi')
9
+
10
+ # git properties
11
+ path_to_git = Path(__file__).parent
12
+ print(path_to_git)
13
+ repo = Repo(path_to_git)
14
+ active_branch = repo.active_branch
15
+ active_tag = None
16
+ for tag in repo.tags:
17
+ if tag.commit == active_branch.commit:
18
+ active_tag = tag.name
19
+ break
20
+ git_active_branch = active_branch.name
21
+ print(git_active_branch)
22
+ git_active_hash = str(active_branch.commit)
23
+ print(git_active_hash)
24
+ git_active_tag = active_tag
25
+ print(git_active_tag)