From 624f8c57002f97eb2818aeb6f3a408da924ef145 Mon Sep 17 00:00:00 2001 From: testvalue Date: Wed, 18 Mar 2026 19:29:10 -0400 Subject: [PATCH 1/5] fix: preserves CHANGELOG.md during render --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index bd085b7..815e173 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,7 @@ render: ! -name '.serena' \ ! -name 'template' ! -name 'includes' ! -name 'copier.yaml' \ ! -name 'hack' ! -name 'tests' ! -name 'pytest.ini' \ - ! -name 'flake.lock' \ + ! -name 'flake.lock' ! -name 'CHANGELOG.md' \ -exec rm -rf {} + # Regenerate from template copier copy --vcs-ref=HEAD --trust --defaults \ From 53a9cdd69c3b1ce97ad177814010a463627b1eea Mon Sep 17 00:00:00 2001 From: testvalue Date: Wed, 18 Mar 2026 19:41:53 -0400 Subject: [PATCH 2/5] fix: adds trailing newline to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc01fe..599ec43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,4 +33,4 @@ All notable changes to this project will be documented in this file. See [conven - - - -Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). \ No newline at end of file +Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). From 0ddcc25d98d45a71dc83be00900f4da0600cada2 Mon Sep 17 00:00:00 2001 From: testvalue Date: Wed, 18 Mar 2026 19:47:41 -0400 Subject: [PATCH 3/5] fix: ensures trailing newline in cog-generated CHANGELOG.md --- cog.toml | 5 ++++- template/cog.toml.jinja | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cog.toml b/cog.toml index 6615617..886800e 100644 --- a/cog.toml +++ b/cog.toml @@ -9,8 +9,11 @@ branch_whitelist = ["main"] # `` will be interpreted as your target version # `` includes the version and the `tag_prefix` post_bump_hooks = [ + # Ensure CHANGELOG.md has a trailing newline + "sh -c 'echo >> CHANGELOG.md && git add CHANGELOG.md && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag -"git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"] + "git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'", +] # Prefix tags with "v" to easily identify them as # "version" or release tags diff --git a/template/cog.toml.jinja b/template/cog.toml.jinja index b4b01c4..7c1206d 100644 --- a/template/cog.toml.jinja +++ b/template/cog.toml.jinja @@ -9,6 +9,8 @@ branch_whitelist = ["{{ "." | gitdefaultbranch }}"] # `{{version}}` will be interpreted as your target version # `{{version_tag}}` includes the version and the `tag_prefix` post_bump_hooks = [ + # Ensure CHANGELOG.md has a trailing newline + "sh -c 'echo >> CHANGELOG.md && git add CHANGELOG.md && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag {% raw %}"git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"{% endraw %} ] From e95ddb0225e88b50feb1e676a89b6d7a715915d9 Mon Sep 17 00:00:00 2001 From: testvalue Date: Wed, 18 Mar 2026 19:57:15 -0400 Subject: [PATCH 4/5] fix: aligns cog.toml with template render output --- cog.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cog.toml b/cog.toml index 886800e..03961f3 100644 --- a/cog.toml +++ b/cog.toml @@ -12,8 +12,7 @@ post_bump_hooks = [ # Ensure CHANGELOG.md has a trailing newline "sh -c 'echo >> CHANGELOG.md && git add CHANGELOG.md && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag - "git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'", -] +"git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"] # Prefix tags with "v" to easily identify them as # "version" or release tags From 481348ea48a31833c0f49a8bd01e611852a95949 Mon Sep 17 00:00:00 2001 From: testvalue Date: Wed, 18 Mar 2026 20:31:58 -0400 Subject: [PATCH 5/5] fix: uses conditional newline to prevent accumulation in CHANGELOG.md --- cog.toml | 2 +- template/cog.toml.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cog.toml b/cog.toml index 03961f3..f854665 100644 --- a/cog.toml +++ b/cog.toml @@ -10,7 +10,7 @@ branch_whitelist = ["main"] # `` includes the version and the `tag_prefix` post_bump_hooks = [ # Ensure CHANGELOG.md has a trailing newline - "sh -c 'echo >> CHANGELOG.md && git add CHANGELOG.md && git commit --amend --no-edit'", + "sh -c 'f=CHANGELOG.md; test \"$(tail -c1 $f)\" && echo >> $f; git add $f && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag "git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"] diff --git a/template/cog.toml.jinja b/template/cog.toml.jinja index 7c1206d..3268d11 100644 --- a/template/cog.toml.jinja +++ b/template/cog.toml.jinja @@ -10,7 +10,7 @@ branch_whitelist = ["{{ "." | gitdefaultbranch }}"] # `{{version_tag}}` includes the version and the `tag_prefix` post_bump_hooks = [ # Ensure CHANGELOG.md has a trailing newline - "sh -c 'echo >> CHANGELOG.md && git add CHANGELOG.md && git commit --amend --no-edit'", + "sh -c 'f=CHANGELOG.md; test \"$(tail -c1 $f)\" && echo >> $f; git add $f && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag {% raw %}"git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"{% endraw %} ]