Skip to content

Commit 46428f7

Browse files
committed
Setup diagnostic script: Print branch name and status
1 parent 3ab9d7f commit 46428f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/tools/summarise_o2p_setup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ fi
3838

3939
for repo in alidist O2 O2Physics; do
4040
[[ -d "${repo}" ]] || { echo "Directory ${repo} not found in the current directory."; continue; }
41-
echo "Last commit of ${repo}: $(cd "${repo}" && git log -n 1 --pretty="format:%ci %h")"
41+
cd "${repo}" || { echo "Failed for enter ${repo}"; return 1; }
42+
commit="$(git log -n 1 --pretty="format:%ci %h")"
43+
branch="$(git rev-parse --abbrev-ref HEAD)"
44+
git diff --quiet && status="clean" || status="modified"
45+
cd - > /dev/null || { echo "Failed for leave ${repo}"; return 1; }
46+
echo "Current commit of ${repo}: $commit (branch $branch, $status)"
4247
done
4348

4449
# Package build info

0 commit comments

Comments
 (0)