Merge v4-beta to v4 (2026-05-25)#167
Open
dbolotin wants to merge 2 commits into
Open
Conversation
Comment on lines
+45
to
+49
| tmp_script="$(mktemp)" | ||
| cat "${0}" > "${tmp_script}" | ||
| chmod +x "${tmp_script}" | ||
| __REAL_RUN="true" "${tmp_script}" | ||
| exit 0 |
There was a problem hiding this comment.
The temp file created by
mktemp is never removed. If ${tmp_script} fails mid-run (e.g., merge conflict, push rejected), the script exits via set -e and the file lingers in /tmp. Adding a trap immediately after the mktemp call ensures cleanup on any exit. The same gap exists in merge-beta.sh.
Suggested change
| tmp_script="$(mktemp)" | |
| cat "${0}" > "${tmp_script}" | |
| chmod +x "${tmp_script}" | |
| __REAL_RUN="true" "${tmp_script}" | |
| exit 0 | |
| tmp_script="$(mktemp)" | |
| trap "rm -f \"${tmp_script}\"" EXIT | |
| cat "${0}" > "${tmp_script}" | |
| chmod +x "${tmp_script}" | |
| __REAL_RUN="true" "${tmp_script}" | |
| exit 0 |
Prompt To Fix With AI
This is a comment left during a code review.
Path: fix-beta.sh
Line: 45-49
Comment:
The temp file created by `mktemp` is never removed. If `${tmp_script}` fails mid-run (e.g., merge conflict, push rejected), the script exits via `set -e` and the file lingers in `/tmp`. Adding a `trap` immediately after the `mktemp` call ensures cleanup on any exit. The same gap exists in `merge-beta.sh`.
```suggestion
tmp_script="$(mktemp)"
trap "rm -f \"${tmp_script}\"" EXIT
cat "${0}" > "${tmp_script}"
chmod +x "${tmp_script}"
__REAL_RUN="true" "${tmp_script}"
exit 0
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge v4-beta into v4
Greptile Summary
Adds
fix-beta.sh, the inverse companion tomerge-beta.sh, which re-syncsv4-betawithv4when the two branches have diverged (e.g. after a direct commit tov4or after amerge-beta.shpromotion cycle).origin/v4intov4-betawith--strategy-option theirs(v4 content wins on conflicts), then runs a two-pattern sed flip to convert@v4refs back to@v4-betawithout the@v4-beta-betadouble-replacement hazard.merge-beta.shso the script survives the branch checkout, and addsset -o pipefail(an improvement overmerge-beta.sh).merge-beta.sh(which amends the merge commit), the sed flip here is committed as a separate commit on top of the merge commit before pushing directly tov4-beta.Confidence Score: 4/5
Safe to merge; the script is a well-documented utility that mirrors an existing pattern in the repo and has no functional bugs.
The core logic — dirty-tree guard, self-reexec, merge-with-theirs, two-pattern sed flip, conditional commit, push — is correct. The only notable gap is the mktemp temp file not being cleaned up on failure, which is a minor hygiene issue that also exists in the pre-existing merge-beta.sh.
No files require special attention; fix-beta.sh is the only change and it follows established patterns in this repo.
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Merge v4-beta into v4" | Re-trigger Greptile