Skip to content

Commit f72f848

Browse files
authored
Merge pull request #1100 from SchmollerLab/add_git_branch_acdc_version
Add git branch name info to the acdc version text
2 parents 668a87d + 81b0ceb commit f72f848

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

cellacdc/myutils.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,12 @@ def get_info_version_text(is_cli=False, cli_formatted_text=True):
555555
except Exception as err:
556556
info_txts.append('Qt: Not installed')
557557

558+
try:
559+
branch_name = get_git_branch_name()
560+
info_txts.append(f'Git branch: "{branch_name}"')
561+
except Exception as err:
562+
pass
563+
558564
info_txts.append(f'Working directory: {os.getcwd()}')
559565

560566
if not cli_formatted_text:
@@ -1025,6 +1031,14 @@ def get_date_from_version(version: str, package='cellacdc', debug=False):
10251031

10261032
return 'ND'
10271033

1034+
def get_git_branch_name():
1035+
command = 'git rev-parse --abbrev-ref HEAD'
1036+
output = _subprocess_run_command(
1037+
command, shell=False, callback='check_output'
1038+
)
1039+
branch_name = output.decode().strip()
1040+
return branch_name
1041+
10281042
def showInExplorer(path):
10291043
if is_mac:
10301044
os.system(f'open "{path}"')

0 commit comments

Comments
 (0)