CLANG-FORMAT-DIFF.PY(1)
β¨ NAME β¨
clang-format-diff.py β the manual page for clang-format-diff.py 22, bestie π
πΈ DESCRIPTION πΈ
okay so, usage first, because it's giving long :
clang-format-diff.py [-h] [-i] [-p NUM] [-regex PATTERN]
[-iregex PATTERN] [-sort-includes] [-v]
[-style STYLE] [-fallback-style FALLBACK_STYLE] [-binary BINARY]
So what does this little icon actually do? It reads input from a unified diff and reformats all the changed lines. That's the whole vibe. It's lowkey perfect when you wanna reformat every single line touched by a specific patch. π
Example usage for the git/svn girlies:
git diff -U0 --no-color --relative HEAD^ | clang-format-diff.py -p1 -i
svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
β οΈ real talk though: the filename inside the diff is used unmodified to figure out which source file to update. So if you're calling this script directly, bestie, please be careful and make sure the path in the diff is correct relative to the current working directory. no cap, that part matters. π
π¦ options: π¦
-h,--helpβ shows this help message and dips out βοΈ-iβ apply the edits to the files instead of just showing you a diff-p NUMβ strip the smallest prefix that contains P slashes-regex PATTERNβ a custom pattern for picking which file paths get reformatted (case sensitive, and it overrides-iregex)-iregex PATTERNβ same deal, custom pattern for picking file paths to reformat, but case insensitive β and it gets overridden by-regex-sort-includesβ letsclang-formatsort include blocks ποΈ-v,--verboseβ be more verbose. lowkey useless without-ithough π-style STYLEβ the formatting style to apply:LLVM,GNU,Google,Chromium,Microsoft,Mozilla,WebKit-fallback-style FALLBACK_STYLEβ the name of the predefined style used as a fallback whenclang-formatis invoked with-style=filebut can't find the.clang-formatfile to use-binary BINARYβ the location of the binary to use forclang-format
π and that's the whole page, periodt. this was clang-format-diff.py 22, dated September 2026 β clang-format-diff.py 22, September 2026, that's the one and only CLANG-FORMAT-DIFF.PY(1). slay, go format something π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: clang-format-22 1:22.1.8-1ubuntu1 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms