Skip to content

Conversation

@nordicjm
Copy link
Contributor

Adds an example of how to add the git index file (if this is inside of a git repo) to the dependencies of the application version file, which allows the git commit of the application version to be updated as new commits are added

Adds an example of how to add the git index file (if this is inside
of a git repo) to the dependencies of the application version file,
which allows the git commit of the application version to be
updated as new commits are added

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
@nordicjm nordicjm requested a review from tejlmand October 31, 2025 09:26
Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Neat. I wonder if this could somehow be added as a hook in the main Zephyr repo?

@nordicjm
Copy link
Contributor Author

nordicjm commented Nov 3, 2025

Neat. I wonder if this could somehow be added as a hook in the main Zephyr repo?

It was added with one originally but Torsten did not like introducing a git dependency on application repos: zephyrproject-rtos/zephyr#98210 (comment)

Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

Thanks, some small observations

OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE stderr
RESULT_VARIABLE return_code)
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor nit.

Suggested change
RESULT_VARIABLE return_code)
RESULT_VARIABLE return_code
)

# without a dependency, this will be the case with freestanding applications.
if(NOT return_code)
if(NOT "${stderr}" STREQUAL "")
message(WARNING "APPLICATION_BUILD_VERSION: git rev-parse warned: ${stderr}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using upper case and _ makes APPLICATION_BUILD_VERSION looks like it's referring to a CMake var, which doesn't seem the case, so can be a bit misleading / confusing.

What's the reason for APPLICATION_BUILD_VERSION: first, or could there be another option ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants