make: Add git-log targets and record last successful run #111

Merged
Jan Lindemann merged 2 commits from jan/feature/20260916-make-add-git-log-targets-and-record-last-successful-run into master 2026-09-16 18:26:31 +02:00 AGit

This PR makes the history of a jw-pkg tree easier to inspect and to act on: git-log targets show the recent commits of one project or of every project in the workspace, and a new run-success.mk writes the commit of the last successful run or test into a marker file, so a regression bisect starts from a known-good base.

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

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
This PR makes the history of a `jw-pkg` tree easier to inspect and to act on: `git-log` targets show the recent commits of one project or of every project in the workspace, and a new `run-success.mk` writes the commit of the last successful run or test into a marker file, so a regression bisect starts from a known-good base. #### 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 #### 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 ```
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 <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
run-success.mk: Record last successful run
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m16s
CI / Packaging test (push) Successful in 0s
2fcda74277
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 <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-16 18:16:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!111
No description provided.