From 24fec38f75e601dce83443a0f8a0282451f484d0 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 16 Sep 2026 17:31:50 +0200 Subject: [PATCH 1/2] rules.mk, projects-dir.mk: Add git-log targets The git targets of the workspace Makefile cover push, diff, and status, but not history: inspecting commits means running git log by hand in a project directory, and no target shows the history of all projects of a tree at once. Add git-log targets at both levels; the target suffix is passed to git log as-is, so make git-log-5 asks for the last five commits. - git-log-% in projects-dir.mk runs pgit.sh log over every project of the tree, one section per project - git-log-% in rules.mk runs git log -$* in the current project directory - git-log-tree-% in rules.mk runs git-log-$* in $(PROJECTS_DIR), giving the whole-tree view from inside a project; it prints a notice if PROJECTS_DIR is missing Signed-off-by: Jan Lindemann Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1 --- make/projects-dir.mk | 3 +++ make/rules.mk | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 411fb034..4b642ab1 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -337,6 +337,9 @@ git-short-diff: $(SSH_WRAPPER_SH) git-status: $(PGIT_SH) status -uno +git-log-%: + $(PGIT_SH) log -$* 2>&1 + git-get: $(SSH_WRAPPER_SH) $(PGIT_SH_GET_DEFAULT) touch get.done diff --git a/make/rules.mk b/make/rules.mk index 0179fbbb..e64fca06 100644 --- a/make/rules.mk +++ b/make/rules.mk @@ -243,6 +243,16 @@ ifneq ($(EXE_PATH),) endif endif +git-log-%: + git log -$* 2>&1 + +git-log-tree-%: +ifneq ($(PROJECTS_DIR),) + make --no-print-directory -C $(PROJECTS_DIR) git-log-$* 2>&1 +else + @echo "No PROJECTS_DIR defined to log commits for" +endif + # -- special built-in targets .PRECIOUS: $(LOCAL_H) -- 2.55.0 From 2fcda74277f9833863884efadbcf2d86276a8dad Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 16 Sep 2026 16:17:04 +0200 Subject: [PATCH 2/2] run-success.mk: Record last successful run Add a run-success.mk which provides a $(RUN_SUCCESS_CREATE_MARKER) variable, and include it from run.mk and py-run.mk. If it's not overridden, it logs the current commit to a marker file if the run succeeds. The marker file is ignored from Git and cleaned in the context of the distclean target. The machinery can be customized by variables: RUN_SUCCESS_MARKER is the name of the marker file RUN_SUCCESS_RECORD_CMD is the generator for its content For example, putting this into local.mk or jw-pkg/make/local.mk will record the hashes of every repository in the entire workspace: define RUN_SUCCESS_RECORD_CMD make git-log-1 make git-log-tree-1 endef Signed-off-by: Jan Lindemann --- .gitignore | 8 +++----- conf/templates/gitignore | 1 + make/py-run.mk | 2 ++ make/run-success.mk | 15 +++++++++++++++ make/run.mk | 3 +++ 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 make/run-success.mk diff --git a/.gitignore b/.gitignore index bb98da71..2f6f064a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ *tmp* *~ .cache-project.mk -.cache-projects.mk .exrc .feedfs_history .gdb_history @@ -38,20 +37,19 @@ bin/*.tcl conftest.py core dist +last-successful-run.txt ld-*.conf local.conf local.mk -local.mk local.yaml make/*.pc -make/ssh-wrapper.sh mkspec.sh pr-descr*.txt pre-local.mk pyproject.toml pyrightconfig.json test-out.txt -test/integration/jw-pkg/projects/cache/test-pyproject.toml -test/integration/jw-pkg/projects/cache/test-pyrightconfig.json !*.jw-tmpl !*.tmpl +.cache-projects.mk +make/ssh-wrapper.sh diff --git a/conf/templates/gitignore b/conf/templates/gitignore index a64843f4..003b5541 100644 --- a/conf/templates/gitignore +++ b/conf/templates/gitignore @@ -38,6 +38,7 @@ bin/*.tcl conftest.py core dist +last-successful-run.txt ld-*.conf local.conf local.mk diff --git a/make/py-run.mk b/make/py-run.mk index c2c8f80f..629f88b1 100644 --- a/make/py-run.mk +++ b/make/py-run.mk @@ -1,6 +1,7 @@ include $(JWBDIR)/make/defs.mk include $(JWBDIR)/make/py-defs.mk include $(JWBDIR)/make/test-guard.mk +include $(JWBDIR)/make/run-success.mk EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py)) EXE_ARGS ?= @@ -14,6 +15,7 @@ test: all testability run: $(PYTHON_RUNNER) $(EXE) $(EXE_ARGS) + $(RUN_SUCCESS_CREATE_MARKER) run.sh: echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp diff --git a/make/run-success.mk b/make/run-success.mk new file mode 100644 index 00000000..ae4927ba --- /dev/null +++ b/make/run-success.mk @@ -0,0 +1,15 @@ +ifndef RUN_SUCCESS_RECORD_CMD + RUN_SUCCESS_RECORD_CMD := git log --oneline -1 +endif + +ifndef RUN_SUCCESS_MARKER + RUN_SUCCESS_MARKER := last-successful-run.txt +endif + +RUN_SUCCESS_CREATE_MARKER = $(RUN_SUCCESS_RECORD_CMD) > $(RUN_SUCCESS_MARKER).tmp && \ + mv $(RUN_SUCCESS_MARKER).tmp $(RUN_SUCCESS_MARKER) +all: + +distclean: distclean.run-success +distclean.run-success: + rm -f $(RUN_SUCCESS_MARKER) diff --git a/make/run.mk b/make/run.mk index 95fd8b91..ac106315 100644 --- a/make/run.mk +++ b/make/run.mk @@ -5,6 +5,7 @@ include $(JWBDIR)/make/defs.mk include $(JWBDIR)/make/defs-cpp.mk +include $(JWBDIR)/make/run-success.mk DIR_BASENAME = $(notdir $(CWD)) @@ -76,6 +77,7 @@ run test: run-deps @echo "wine $(EXE_CMD)" @echo -e "set PATH=%PATH;$(DLL_PATH)\n" \ "$(EXE_CMD)" | wine cmd + $(RUN_SUCCESS_CREATE_MARKER) start: run-deps @echo "wine $(EXE_CMD)" @@ -85,6 +87,7 @@ start: run-deps else run test: run-deps $(EXE_CMD) + $(RUN_SUCCESS_CREATE_MARKER) start: run-deps $(EXE_CMD) & -- 2.55.0