Use git worktree in diffcheck.sh to avoid mutating the working tree #1978

pull viktorking7 wants to merge 3 commits into bitcoin:master from viktorking7:master changing 1 files +42 −10
  1. viktorking7 commented at 11:03 am on September 23, 2025: none

    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
  2. Update diffcheck.sh c292dbc5a4
  3. jonatack commented at 5:02 pm on September 23, 2025: member
    Thanks for your proposal, @viktorking7. There is a similar existing proposal in #1924 – would you mind reviewing it?
  4. jonatack added the label CI on Sep 23, 2025
  5. jonatack commented at 5:03 pm on September 23, 2025: member
    Also, note that this change did not pass CI. Putting this into draft until it does.
  6. jonatack marked this as a draft on Sep 23, 2025
  7. Update diffcheck.sh ad4c3abbdd
  8. Update diffcheck.sh 035c55740c
  9. viktorking7 marked this as ready for review on Sep 23, 2025
  10. viktorking7 requested review from jonatack on Sep 23, 2025
  11. jonatack commented at 10:52 pm on September 24, 2025: member
    @viktorking7, this is still not passing CI. There is a similar, already existing proposal in #1924 – would you mind reviewing it, please?


viktorking7 jonatack


jonatack

Labels
CI


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-12 05:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me