diff --git a/AGENTS.md b/AGENTS.md index 863bf11..8ad12fc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -286,6 +286,14 @@ branch made the series `queued`, all four patches by message-id. even though its patches reach that tree through a pull. Following pulls upward is not in MAINTAINERS. - Mainline (`torvalds/linux`) is never proposed as a maintainer tree. +- **Series the mail calls `applied` are included** (2026-11-11): the + first live run skipped every DONE state, so the two series a + maintainer had answered "Applied" never got their trees (input, iio), + and nothing could confirm the mail. +- **"not in" names at most two trees.** With 29 trees checked, the note + on an applied series listed them all, and `list` cut it after the + first ("not in battery …" on an input patch). More than two are + counted; `show` still lists each. - **Defaults, so a kernel checkout needs no options**: MAINTAINERS from `--maintainers`, else the mainline tree, else the current directory's repository; Next/Trees from `--next-trees`, else the next tree's copy, diff --git a/CHANGELOG.md b/CHANGELOG.md index e43f2b4..55728b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.2.0 + - **`tree discover`** finds the maintainer trees for your open series: the MAINTAINERS sections covering their files (as get_maintainer.pl reads them), their `T:` trees, and the branch from linux-next's @@ -10,6 +12,10 @@ mainline tree or the current directory, Next/Trees from linux-next. For a tree whose branch neither file names, it lists the branches and asks which one (in a terminal), or prints the `tree add` command to finish. + Series a maintainer's mail calls applied are included, so their tree + can confirm it. +- An applied series missing from more than two trees says "not in any + of the N trees checked" instead of naming them all. ## 0.1.0 diff --git a/src/patchtrack/__init__.py b/src/patchtrack/__init__.py index 20537cb..571e558 100644 --- a/src/patchtrack/__init__.py +++ b/src/patchtrack/__init__.py @@ -1,3 +1,3 @@ """Track an author's patches on public-inbox mailing lists.""" -__version__ = "0.1.0" +__version__ = "0.2.0" diff --git a/src/patchtrack/cli.py b/src/patchtrack/cli.py index f387003..d4710d2 100644 --- a/src/patchtrack/cli.py +++ b/src/patchtrack/cli.py @@ -632,8 +632,9 @@ def cmd_tree(args, db): then their source of truth (``tree rm`` refuses them). ``tree discover`` finds the trees for you. Run in a kernel checkout, - ``patchtrack tree discover --add`` is all it takes. For each open - series it reads the files the patches touch, finds the MAINTAINERS + ``patchtrack tree discover --add`` is all it takes. For each series + not yet found in a tree (open ones, and those a maintainer's mail + calls applied) it reads the files the patches touch, finds the MAINTAINERS sections that cover them (as ``get_maintainer.pl`` does) and lists their ``T:`` trees. Where a ``T:`` line names no branch, linux-next's ``Next/Trees`` supplies the one that feeds linux-next. A tree in @@ -761,7 +762,8 @@ def _tree_discover(args, db): found = _load(args, db) heads, to_add, open_ends, elsewhere = {}, {}, {}, [] for fam in series.families(found, db.closed()): - if fam.closed is not None or (not args.all and fam.state in series.DONE): + # "applied" stays in: the mail says so, and its tree is how to confirm it + if fam.closed is not None or (not args.all and fam.state in series.DONE - {"applied"}): continue s = fam.head if not routed_to & {a.lower() for a in s.to}: @@ -1150,7 +1152,7 @@ def command(name, func, helptext): sp.add_argument("--no-ls-remote", dest="ls_remote", action="store_false", help="discover: do not list the branches of trees whose branch is unknown") sp.add_argument("--add", action="store_true", help="discover: add the trees whose branch is known") - sp.add_argument("--all", action="store_true", help="discover: applied and merged series too") + sp.add_argument("--all", action="store_true", help="discover: queued, in-next, merged and superseded series too") sp.add_argument("-a", "--author", action="append", help="discover: default: every author synced") sp.add_argument("-l", "--list", help="discover: only series found by a sync of this inbox") sp.set_defaults(func=cmd_tree) diff --git a/src/patchtrack/series.py b/src/patchtrack/series.py index 55ae6b6..5a2b956 100644 --- a/src/patchtrack/series.py +++ b/src/patchtrack/series.py @@ -311,7 +311,12 @@ def _derive(s): s.evidence += "; no \"applied\" mail in the thread" elif done == 1: s.state = "applied" - if misses: + if len(misses) > 2: + # With trees discovered for every subsystem, naming them all hides + # the fact; `show` lists each tree's result. + s.evidence += (f"; not in any of the {len(misses)} trees checked, as of " + f'{max(misses.values())[:16].replace("T", " ")}') + elif misses: # Today's most useful fact: a maintainer said so, the trees do not show it yet. s.evidence += "; not in " + ", ".join( f'{t} as of {w[:16].replace("T", " ")}' for t, w in sorted(misses.items())) diff --git a/tests/test_maintainers.py b/tests/test_maintainers.py index 91c648d..51ecfa0 100644 --- a/tests/test_maintainers.py +++ b/tests/test_maintainers.py @@ -154,6 +154,7 @@ def setUp(self): self.db_path = os.path.join(self.tmp.name, "t.sqlite3") db = store.Store(self.db_path) for tag, path, to in (("net", "drivers/net/a.c", "netdev@example.org"), + ("taken", "drivers/net/b.c", "netdev@example.org"), ("vendor", "drivers/net/vendor/x.c", "netdev@example.org"), ("other", "drivers/net/a.c", "other-project@example.org")): m = mail(f"{tag}-1@x", f"[PATCH] {tag}: change", ME, @@ -161,6 +162,9 @@ def setUp(self): "@@ -1 +1 @@\n-a\n+b\n") m["To"] = to db.add(m) + # a maintainer's "Applied" reply: its tree is how to confirm it + db.add(mail("taken-reply@x", "Re: [PATCH] taken: change", "net@example.org", irt="taken-1@x", + body="Applied to net-next, thanks!", date="Tue, 06 Oct 2026 10:00:00 +0000")) db.commit() db.close() @@ -204,6 +208,7 @@ def test_report(self): self.assertIn("https://github.com/vendor/wireless (no branch", out) self.assertIn("another project's series): 1\n [PATCH] other: change", out) self.assertNotIn("torvalds", out) + self.assertIn("[PATCH] taken: change (1 patch) [applied]", out) self.assertIn("branches: main pending queue", out) self.assertIn("patchtrack tree add vendor-wireless --repo", out) diff --git a/tests/test_trees.py b/tests/test_trees.py index 8d70b4c..3d63883 100644 --- a/tests/test_trees.py +++ b/tests/test_trees.py @@ -189,6 +189,15 @@ def test_mail_says_applied_tree_does_not(self): self.assertEqual(s.state, "applied") self.assertIn("not in foo as of 2026-10-26 00:00", s.evidence) + def test_many_trees_missing_are_counted_not_listed(self): + names = ["a", "b", "c"] + s = self.series_with({1: [row(n, "maintainer", None) for n in names]}, applied_mail=True) + self.assertEqual(s.state, "applied") + self.assertIn("not in any of the 3 trees checked, as of 2026-10-26 00:00", s.evidence) + self.assertNotIn("not in a as of", s.evidence) + s = self.series_with({1: [row(n, "maintainer", None) for n in names[:2]]}, applied_mail=True) + self.assertIn("not in a as of 2026-10-26 00:00, b as of", s.evidence) + if __name__ == "__main__": unittest.main()