Skip to content

Instantly share code, notes, and snippets.

@scarf005
Last active April 22, 2025 14:21
Show Gist options
  • Save scarf005/a5c1da9f8b70421beef1b8c590fa3c9a to your computer and use it in GitHub Desktop.
Save scarf005/a5c1da9f8b70421beef1b8c590fa3c9a to your computer and use it in GitHub Desktop.

how to only commit successfully fixed files:

  1. run checks
parallel clang-tidy --enable-check-profile --store-check-profile=clang-tidy-trace -fix '--checks=-\*,modernize-use-ranges' {} ::: src/*.{cpp,h}
  1. collect failing build error messages
ninja -C build -j 10 -k 0 cataclysm-bn-tiles 2&> build.log
  1. gather files failed to build
rg 'FAILED:\s*src/.*/(.*).cpp.o' build.log --replace 'src/$1.cpp' -N > ignore.log
  1. remove them
cat ignore.log | xargs git restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment