diff --git a/copier_python/update.py b/copier_python/update.py index be9d904..52f485d 100644 --- a/copier_python/update.py +++ b/copier_python/update.py @@ -1,7 +1,6 @@ from __future__ import annotations import json -import os import subprocess from contextlib import contextmanager from dataclasses import dataclass, field @@ -73,16 +72,10 @@ def _run(self, repo: RepoWorktree) -> str | None: with self._success_or_shell(repo, "Lint/test"): repo.run_task("lt") - title = "Apply template updates" + title = f"Apply template updates from {start_ref} to {end_ref}" body = "" if start_ref and end_ref and start_ref != end_ref: - ref_range = f"{start_ref}...{end_ref}" - body = os.linesep.join( - ( - f"Applied updates from template: {ref_range}", - f"{TEMPLATE_REPO_URL}/compare/{ref_range}", - ) - ) + body = f"{TEMPLATE_REPO_URL}/compare/{start_ref}...{end_ref}" repo.run(["git", "add", "-A"]) repo.run(["git", "commit", "-m", f"{title}\n\n{body}".strip()]) diff --git a/tests/test_update.py b/tests/test_update.py index 4a6fb99..fb123e7 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -282,9 +282,8 @@ def _postcreate(project: Path) -> None: create_project(vcs_ref=start_ref, postcreate=_postcreate) commit_message = os.linesep.join( ( - "Apply template updates", + f"Apply template updates from {start_ref} to {end_ref}", "", - (f"Applied updates from template: {start_ref}...{end_ref}"), ( f"https://github.com/smkent/copier-python/compare/" f"{start_ref}...{end_ref}" @@ -385,9 +384,8 @@ def test_main_update_with_project( create_project(vcs_ref=start_ref, project_visibility=project_visibility) commit_message = os.linesep.join( ( - "Apply template updates", + f"Apply template updates from {start_ref} to {end_ref}", "", - (f"Applied updates from template: {start_ref}...{end_ref}"), ( f"https://github.com/smkent/copier-python/compare/" f"{start_ref}...{end_ref}"