Skip to content
Fangrui Song edited this page May 23, 2025 · 2 revisions

I use a script mkreproduce to create a self-contained shell script reproduce.

For a maintainer to analyze toolchain issues, it's much easier if the needed files can be created by copying and executing a command. It's much easier to analyze an issue if the extra files are contained in a single comment, not requiring to download an attachment.

% ls
a.lds  a.o  a.out*  a.s
% mkreproduce
cat > a.lds <<'eof'
SECTIONS {
  . = 0x1000;
  .text : { *(.text) }
}
eof
cat > a.s <<'eof'
.globl _start; _start: .space 4
.data; .byte 0
eof

Then I copy the output to an issue/Discourage post/etc.


https://stackoverflow.com/questions/43489303/how-can-i-delete-all-git-branches-which-have-been-squash-and-merge-via-github

git checkout -q master && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done
git checkout -q main && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base main $branch) && [[ $(git cherry main $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done
Clone this wiki locally