Skip to content

Conversation

viktorking7
Copy link

Summary

Replace git checkout HEAD^ with a temporary detached git worktree in scripts/diffcheck.sh. This eliminates side effects on the current branch and ensures clean cleanup.

Changes

  • Add strict shell mode: set -Eeuo pipefail
  • Use mktemp for temp files/dirs
  • Build previous commit table in a detached worktree
  • Add trap cleanup to remove worktree and temps

Why

  • Prevents leaving the repo in detached HEAD
  • Avoids accidental loss of uncommitted changes
  • More CI-friendly and reproducible

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your proposal, @viktorking7. There is a similar existing proposal in #1924 -- would you mind reviewing it?

@jonatack jonatack added the CI label Sep 23, 2025
@jonatack
Copy link
Member

Also, note that this change did not pass CI. Putting this into draft until it does.

@jonatack jonatack marked this pull request as draft September 23, 2025 17:04
@viktorking7 viktorking7 marked this pull request as ready for review September 23, 2025 17:38
@jonatack
Copy link
Member

@viktorking7, this is still not passing CI. There is a similar, already existing proposal in #1924 -- would you mind reviewing it, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants