Skip to content

Commit 4d30aec

Browse files
Display both local and remote git SHA versions in system banner (#139)
* Initial plan * Display both local and remote git SHA versions in system banner Co-authored-by: paolomainardi <8747+paolomainardi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: paolomainardi <8747+paolomainardi@users.noreply.github.com>
1 parent 3b75fa1 commit 4d30aec

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

bin/common/utils.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,16 @@ get_version_info() {
6262
fi
6363
cd /opt/sparkdock
6464
local current_branch=$(git rev-parse --abbrev-ref HEAD)
65-
local current_version=$(git rev-parse --short HEAD)
65+
local local_version=$(git rev-parse --short HEAD)
6666
local last_commit_date=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
67-
echo "Version: ${current_version} (${current_branch})"
67+
68+
# Get remote version (fetch quietly to get latest remote info)
69+
local remote_version="unknown"
70+
if git fetch origin "${current_branch}" -q 2>/dev/null; then
71+
remote_version=$(git rev-parse --short "origin/${current_branch}" 2>/dev/null || echo "unknown")
72+
fi
73+
echo "Local version: ${local_version} (${current_branch})"
74+
echo "Remote version: ${remote_version} (${current_branch})"
6875
echo "Last commit: ${last_commit_date}"
6976
echo "Last update: $(get_last_update)"
7077
}

0 commit comments

Comments
 (0)