Skip to content

Commit 1060655

Browse files
authored
🪕 [just] v4.4 fixes a bug in pr_update that ate blank lines (#50)
* 🪕 [just] v4.4 fixes a bug in pr_update that ate blank lines * increment version number * update release notes
1 parent cd55342 commit 1060655

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.just/RELEASE_NOTES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ This file tracks the evolution of the Git/GitHub workflow automation module.
44

55
## December 2025 - Finer refinements
66

7+
### v4.4 - PR Update Blank Line Preservation
8+
9+
Fixed a bug in the `pr_update` recipe where blank lines after the Done section
10+
were being incorrectly removed. The AWK script that preserves sections after
11+
Done had a logic error - after setting `after_done=1`, it continued to match
12+
and skip blank lines because the condition `in_done && /^$/` remained true
13+
even after transitioning to the "after done" state.
14+
15+
- Added `!after_done` guard to blank line and commit matching conditions
16+
- Prevents eating blank lines once we've moved past the Done section
17+
- Preserves original spacing between sections (e.g., Done and Meta)
18+
19+
The fix ensures that when `pr_update` regenerates the Done section with current
20+
commits, it maintains proper markdown formatting with blank lines separating
21+
different sections of the PR description.
22+
23+
**Related PRs:** [#50](https://github.com/fini-net/template-repo/pull/50)
24+
725
### v4.3 - Release Tag Visibility
826

927
Enhanced the `release` recipe to automatically pull the newly created tag so it's

.just/gh-process.just

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sync:
1313
git pull
1414
git status --porcelain # stp
1515

16-
# PR create v4.3
16+
# PR create v4.4
1717
[group('Process')]
1818
pr: _has_commits && pr_checks
1919
#!/usr/bin/env bash
@@ -228,8 +228,8 @@ pr_update: _on_a_pull_request
228228
# look for content after the Done section's commit list
229229
awk 'BEGIN {in_done=0; after_done=0; empty_count=0}
230230
/^## Done/ {in_done=1; next}
231-
in_done && /^$/ {empty_count++; if (empty_count >= 2) after_done=1; next}
232-
in_done && /^- / {next}
231+
in_done && !after_done && /^$/ {empty_count++; if (empty_count >= 2) after_done=1; next}
232+
in_done && !after_done && /^- / {next}
233233
after_done {print}' "$bodyfile" > "$other_sections"
234234
fi
235235

0 commit comments

Comments
 (0)