Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install: Add uncommitted changes check #733

Merged
Merged
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
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# Makefile versions
MAKEFILE_VERSION := 2.2
MAKEFILE_VERSION := 2.3
UPDATE_VERSION := make/latest

# This Makefile requires Python version 3.9 or later
Expand Down Expand Up @@ -269,6 +269,26 @@ verify_version: .venv
exit 1 \
) \
)
@# If there are uncommitted changes or new files, this implies that ADF
@# might be modified, hence we should track that in the version number
@( \
git diff-index --quiet HEAD -- src || ( \
echo '' && \
echo '$(CLR_RED)Error: There are uncommitted changes!$(CLR_END)' && \
echo '$(CLR_RED)Please commit these changes first to continue.$(CLR_END)' && \
echo '' && \
exit 1 \
); \
)
@( \
test -z "$$(git ls-files --others --exclude-standard -- src)" || ( \
echo '' && \
echo '$(CLR_RED)Error: New files were added to ADF its source code!$(CLR_END)' && \
echo '$(CLR_RED)Please commit these changes first to continue.$(CLR_END)' && \
echo '' && \
exit 1 \
); \
)
@# If the version number is not a release-tagged version and we are not in a CI build
@( \
if [ "Z$(SRC_VERSION)" != "Z$(SRC_VERSION_TAG_ONLY)" ] && [ "Z$${CI_BUILD}" = "Z" ]; then \
Expand Down