- 
                Notifications
    You must be signed in to change notification settings 
- Fork 32
Tips
        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.
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