From eaf7228a75ab93dabfd98e9d68e1568e33dfc265 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 19:45:35 -0700 Subject: [PATCH] fix(kde): default compare-gen to the komorebi and komorebi-for-mac trees around it compare-gen.py defaulted to sibling checkouts of the old repos. It now defaults to the Windows tree and macOS tree that sit beside komorebi-for-kde/ in this repository. Verified: runs and finds both trees. --- komorebi-for-kde/CONTRIBUTING.md | 5 +++-- komorebi-for-kde/scripts/compare-gen.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/komorebi-for-kde/CONTRIBUTING.md b/komorebi-for-kde/CONTRIBUTING.md index 6ab1df26..4dbcc490 100644 --- a/komorebi-for-kde/CONTRIBUTING.md +++ b/komorebi-for-kde/CONTRIBUTING.md @@ -103,8 +103,9 @@ older KWin does not have. [`docs/dev/COMPARE.md`](docs/dev/COMPARE.md) compares komorebi for KDE with komorebi for Windows and komorebi for Mac, and its tables are generated by [`scripts/compare-gen.py`](scripts/compare-gen.py) (Python 3 and nothing else) from -this checkout and from checkouts of the other two, `~/komorebi` and -`~/komorebi-for-mac` unless `--kfw` and `--kfm` say otherwise. Continuous +this checkout and from checkouts of the other two: the komorebi repository around it and its +`komorebi-for-mac/` when this is `komorebi-for-kde/` of that repository, else `~/komorebi` and +`~/komorebi-for-mac`, unless `--kfw` and `--kfm` say otherwise. Continuous integration has neither checkout, so it does not run the script. A change to a `komorebic` command, a `SocketMessage`, a key of `komorebi.json`, a `WindowManagerEvent`, a method of `Backend` or a list of keys in `check.rs` is diff --git a/komorebi-for-kde/scripts/compare-gen.py b/komorebi-for-kde/scripts/compare-gen.py index 05f1048a..5834502a 100644 --- a/komorebi-for-kde/scripts/compare-gen.py +++ b/komorebi-for-kde/scripts/compare-gen.py @@ -30,7 +30,9 @@ leaves everything outside them (the prose) alone. --check exits 1 when a block o what would be generated now, and names the blocks; the block `sources` (the revisions read) is skipped, because it changes whenever a source tree moves. --block prints one block. -Defaults: kfw ~/komorebi, kfm ~/komorebi-for-mac, kfde the checkout this script is in. +Defaults: kfde the checkout this script is in; kfw and kfm are the repository around it and its +komorebi-for-mac/ when it is komorebi-for-kde/ of the komorebi repository, else ~/komorebi and +~/komorebi-for-mac. The script is read-only: it reads files, and runs `git log -1` and `git status` in the checkouts of kfw and kfm; it never asks for a remote. @@ -45,6 +47,11 @@ from pathlib import Path HOME = Path.home() HERE = Path(__file__).resolve().parent.parent +# in the komorebi repository this tree is komorebi-for-kde/, next to komorebi-for-mac/, and kfw is the +# repository itself; on its own it sits beside ~/komorebi and ~/komorebi-for-mac +MONOREPO = (HERE.parent / "komorebi-for-mac").is_dir() and (HERE.parent / "komorebi" / "Cargo.toml").is_file() +DEFAULT_KFW = HERE.parent if MONOREPO else HOME / "komorebi" +DEFAULT_KFM = HERE.parent / "komorebi-for-mac" if MONOREPO else HOME / "komorebi-for-mac" ERRORS = [] @@ -1133,8 +1140,8 @@ MARK = re.compile(r"\n(.*?)", re.S) def main(): ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) - ap.add_argument("--kfw", default=str(HOME / "komorebi")) - ap.add_argument("--kfm", default=str(HOME / "komorebi-for-mac")) + ap.add_argument("--kfw", default=str(DEFAULT_KFW)) + ap.add_argument("--kfm", default=str(DEFAULT_KFM)) ap.add_argument("--kfde", default=str(HERE)) ap.add_argument("--update", metavar="FILE") ap.add_argument("--check", metavar="FILE")