From 5654474c630590e8110c31eae578a1275c980d1a Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:18:37 -0800 Subject: [PATCH 1/2] Graduates strip: newest means merged last, not written last Divya's graduation was merged after Karthik's but shown after it, because the order used the time the learner's commit was made. Follow the first parent so the time is the merge's. Co-Authored-By: Claude Opus 5.5 --- tests/test_check_graduate.py | 31 +++++++++++++++++++++++++++++++ tools/graduates_wall.py | 10 +++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/tests/test_check_graduate.py b/tests/test_check_graduate.py index 81b19d3..3a8aa71 100644 --- a/tests/test_check_graduate.py +++ b/tests/test_check_graduate.py @@ -175,3 +175,34 @@ def test_the_repo_front_page_has_the_markers(): text = (wall.ROOT / "README.md").read_text(encoding="utf-8") assert text.count(wall.START) == 1 and text.count(wall.END) == 1 assert text.index(wall.START) < text.index(wall.END) + + +def test_newest_means_merged_last_not_written_last(tmp_path, monkeypatch): + """A learner can write their file days before it's merged; the strip orders by the merge.""" + + def git(*args, when=None): + env = None + if when: + import os + + env = {**os.environ, "GIT_AUTHOR_DATE": when, "GIT_COMMITTER_DATE": when} + return subprocess.run( + ["git", *args], cwd=tmp_path, check=True, capture_output=True, text=True, env=env + ).stdout.strip() + + git("init", "-q", "-b", "main") + git("config", "user.email", "t@example.com") + git("config", "user.name", "t") + git("commit", "-q", "--allow-empty", "-m", "base", when="2026-01-01T00:00:00") + for login, written, merged in (("early", "2026-01-02T00:00:00", "2026-01-10T00:00:00"), + ("late", "2026-01-05T00:00:00", "2026-01-06T00:00:00")): # fmt: skip + git("switch", "-q", "-c", login, "main") + (tmp_path / f"{login}.py").write_text(GOOD.replace('"ada"', f'"{login}"')) + git("add", ".") + git("commit", "-qm", login, when=written) + git("switch", "-q", "main") + git("merge", "-q", "--no-ff", login, "-m", f"merge {login}", when=merged) + + assert wall.added_time(tmp_path / "early.py") > wall.added_time(tmp_path / "late.py") + block = wall.strip(tmp_path) + assert block.index("early.png") < block.index("late.png"), "merged last, shown first" diff --git a/tools/graduates_wall.py b/tools/graduates_wall.py index c37a90c..9066e07 100644 --- a/tools/graduates_wall.py +++ b/tools/graduates_wall.py @@ -56,14 +56,18 @@ class Graduate: repo: str number: str message: str - added: int = 0 # when the file was first committed (seconds), 0 if unknown + added: int = 0 # when the file landed on this branch (seconds), 0 if unknown def added_time(path: Path) -> int: - """When the graduate's file was first committed, so the newest can be shown first.""" + """When the graduate's file landed on this branch, so the newest graduates come first. + + ``--first-parent`` follows the branch's own history, so this is the time + of the merge that brought the file in, not when the learner wrote it. + """ try: out = subprocess.run( - ["git", "log", "--diff-filter=A", "--format=%ct", "--", path.name], + ["git", "log", "--first-parent", "--diff-filter=A", "--format=%ct", "--", path.name], cwd=path.parent, capture_output=True, text=True, From d93f50099e603cbf71dcf31707783f1dfc2f8d9b Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:18:37 -0800 Subject: [PATCH 2/2] README: graduates in the order they were merged Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c93b624..3dc407e 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,8 @@ a key, add `--voice Aman` to narrate with a macOS voice instead. **3 graduates** finished the course with a pull request merged in a real open source project. [See the wall](graduates/) ยท [Join them](lessons/15-capstone/) -@karthikaun @divya0795 +@karthikaun @thejesh23