make: Add git-log targets and record last successful run #111
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260916-make-add-git-log-targets-and-record-last-successful-run"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR makes the history of a
jw-pkgtree easier to inspect and to act on:git-logtargets show the recent commits of one project or of every project in the workspace, and a newrun-success.mkwrites 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 logby hand in a project directory, and no target shows the history of all projects of a tree at once.Add
git-logtargets at both levels; the target suffix is passed togit logas-is, somake git-log-5asks for the last five commits.git-log-%inprojects-dir.mkrunspgit.shlog over every project of the tree, one section per projectgit-log-%inrules.mkrunsgit log -$*in the current project directorygit-log-tree-%inrules.mkrunsgit-log-$*in$(PROJECTS_DIR), giving the whole-tree view from inside a project; it prints a notice ifPROJECTS_DIRis missingrun-success.mk: Record last successful run
Add a
run-success.mkwhich provides a$(RUN_SUCCESS_CREATE_MARKER)variable, and include it fromrun.mkandpy-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 thedistcleantarget.The machinery can be customized by variables:
RUN_SUCCESS_MARKERis the name of the marker fileRUN_SUCCESS_RECORD_CMDis the generator for its contentFor example, putting this into
local.mkorjw-pkg/make/local.mkwill record the hashes of every repository in the entire workspace: