Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/workspace_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
GIT_VERSION=$(git describe --tags --match '[0-9][0-9]Q[0-9]' --always 2>/dev/null \
|| echo "unknown")
echo "STABLE_GIT_VERSION ${GIT_VERSION}"

STA_GIT_SHA1=$(git -C src/sta rev-parse HEAD 2>/dev/null || echo "unknown")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current command git -C src/sta rev-parse HEAD retrieves the commit hash from within the src/sta submodule directory. This approach can be unreliable if the submodule is not initialized or if its state has been locally modified (e.g., a different commit is checked out).

A more robust method for build stamping is to get the submodule's commit hash as it is recorded in the main repository's index. Using git rev-parse HEAD:src/sta achieves this directly and is not affected by the state of the submodule's working directory.

Suggested change
STA_GIT_SHA1=$(git -C src/sta rev-parse HEAD 2>/dev/null || echo "unknown")
STA_GIT_SHA1=$(git rev-parse HEAD:src/sta 2>/dev/null || echo "unknown")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if a different commit is checked out and built it's good we report that rather than what is in the index

echo "STABLE_STA_GIT_SHA1 ${STA_GIT_SHA1}"
Loading