-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-clang-format clears files listed in .clang-format-ignore #102459
Comments
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Aug 9, 2024
With the --force (or -f) option, git-clang-format wipes out input files excluded by a .clang-format-ignore file if they have unstaged changes. This patch adds a hidden clang-format option --list-ignored that lists such excluded files for git-clang-format to filter out. Fixes llvm#102459.
owenca
added a commit
that referenced
this issue
Aug 10, 2024
With the --force (or -f) option, git-clang-format wipes out input files excluded by a .clang-format-ignore file if they have unstaged changes. This patch adds a hidden clang-format option --list-ignored that lists such excluded files for git-clang-format to filter out. Fixes #102459.
llvmbot
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Aug 10, 2024
With the --force (or -f) option, git-clang-format wipes out input files excluded by a .clang-format-ignore file if they have unstaged changes. This patch adds a hidden clang-format option --list-ignored that lists such excluded files for git-clang-format to filter out. Fixes llvm#102459. (cherry picked from commit 986bc3d)
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Aug 13, 2024
With the --force (or -f) option, git-clang-format wipes out input files excluded by a .clang-format-ignore file if they have unstaged changes. This patch adds a hidden clang-format option --list-ignored that lists such excluded files for git-clang-format to filter out. Fixes llvm#102459. (cherry picked from commit 986bc3d)
This was referenced Oct 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
git clang-format
with.clang-format-ignore
, the files listed in.clang-format-ignore
are beeing cleared.Example:
A simple
main.cpp
file located under [project root, location of.clang-format
and.clang-format-ignore
]/src/main.cpp:If I add
src/main.cpp
to.clang-format-ignore
and rungit clang-format -f --style=file
the contents ofmain.cpp
get erased.If I run
clang-format -i --style=file src/main.cpp
the file is ignored and everything works like it's supposed to.The text was updated successfully, but these errors were encountered: