]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Auto-commit: Makefile updated on 3/6/2026
authorvados-dev <vados@vados.ru>
Fri, 6 Mar 2026 16:42:44 +0000 (19:42 +0300)
committervados-dev <vados@vados.ru>
Fri, 6 Mar 2026 16:42:44 +0000 (19:42 +0300)
Makefile

index fec07c6b8bb6bb766b66b67ed82196dc4ad5d951..871d3f127f11d9375738ca19166fb6004790d430 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,20 +19,20 @@ COMM_TAG := $(shell git rev-list --abbrev-commit --tags --max-count=1)
 # `2>/dev/null` suppress errors and `|| true` suppress the error codes.
 TAG := $(shell git describe --abbrev=0 --tags ${COMM_TAG} 2>/dev/null || true)
 # here we strip the version prefix
-TAG_VERS := $(TAG:v%=%)
+TAG_VERS :=$(TAG:v%=%)
 # get the latest commit hash in the short form
 COMM_HASH := $(shell git rev-parse --short=8 HEAD 2>/dev/null) # Get short commit hash
 #COMMIT := $(shell git rev-parse --short HEAD)
 # get the latest commit date in the form of YYYYmmdd
 COMM_DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d%H%M")
 ifneq ($(COMM_HASH), $(COMM_TAG))
-    TAG_VERS := $(TAG_VERS)-next-$(COMM_HASH)-$(COMM_DATE)
+    TAG_VERS :=$(TAG_VERS)-next-$(COMM_HASH)-$(COMM_DATE)
 endif
 ifeq ($(TAG_VERS), )
-    TAG_VERS := $(COMM_HASH)-$(COMM_DATE)
+    TAG_VERS :=$(COMM_HASH)-$(COMM_DATE)
 endif
 ifneq ($(shell git status --porcelain), )
-    TAG_VERS := $(TAG_VERS)-dirty
+    TAG_VERS :=$(TAG_VERS)-dirty
 endif
 
 COMMIT_ID       := $(VERSION)
@@ -50,18 +50,24 @@ checksums.json: bin/checksums.sh $(ALL_RSC)
        bin/checksums.sh > html/tmp/$@
 
 commit: check-uncommitted
+               @echo "Warning: Uncommitted changes detected! Go to autocommit steps..."
+               git branch -v
+               git commit -am "$(COMM_INFO)"
+               git push
 
 
 #@if [ -n "$$(git diff --quiet)" ] && [ -n "$$(git diff --cached --quiet)" ] && [ -n "$$(git ls-files --others --exclude-standard)" ]; then \
 #[ -n "$$(git status --porcelain)" ]
 
 check-uncommitted: 
-       @if [ -n "$$(git diff --quiet)" ] && [ -n "$$(git diff --cached --quiet)" ] && [ -n "$$(git ls-files --others --exclude-standard)" ]; then \
-           echo "Warning: Uncommitted changes detected! Go to autocommit steps..."; \
-       else \
-           echo "Repository is clean (no uncommitted or untracked changes). Go to additional checks..."; \
-           cd $(BUILD_DIR) && \
-               git
+       @if [ -n "$$(git diff --quiet)" ] && [ -n "$$(git diff --cached --quiet)" ] && [ -n "$$(git ls-files --others --exclude-standard)" ]; then :; else \
+           echo "The first checks have been passed, the repo seems to be clean... But... Still, let's check a little more! :)"; \
+           @if [ -n "$$(git status --porcelain)" ]; then \
+                       echo "Repository is clean (no uncommitted or untracked changes). Exit 0."; \
+                       exit 0; \
+               else \
+                       echo "Error! Git status is not porcelain! Check it mannualy. Exit 1."; \
+                       exit 1; \
        fi
 
 
@@ -74,27 +80,6 @@ check-uncommitted:
        exit 0; \
     fi
 
-#check-uncommitted:
-#              @echo "Warning: Uncommitted changes detected! Go to autocmmit...";
-#              git add .
-#              git commit -m $(COMMITINFO)
-#              $@
-
-#.PHONY: check-uncommitted
-#check-uncommitted:
-fake_target:
-       @if git diff --quiet && git diff --cached --quiet && [ -z "$$(git ls-files --others --exclude-standard)" ]; then \
-               echo "Repository is clean (no uncommitted or untracked changes). Exit."; \
-               exit 0; \
-    else \
-        git add . && \
-       fi
-
-#      git add . && \
-#      commitinfo && \
-#    git push origin $(BRANCH)
-#    git commit -m "$(@:git-%=%)"
-
 commitinfo: $(commitinfo.sh)
 
 .PHONY: $(commitinfo.sh)