-
Notifications
You must be signed in to change notification settings - Fork 13.5k
git-clang-format removes unstaged files #65643
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
Closed
adorostkar opened this issue
Sep 7, 2023
· 3 comments
· Fixed by #65723 or llvm/llvm-project-release-prs#736
Closed
git-clang-format removes unstaged files #65643
adorostkar opened this issue
Sep 7, 2023
· 3 comments
· Fixed by #65723 or llvm/llvm-project-release-prs#736
Comments
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Sep 8, 2023
When applying format changes to staged files, git-clang-format erroneously checks out all files in the index and thus may overwrite unstaged changes. Fixes llvm#65643.
owenca
added a commit
that referenced
this issue
Sep 8, 2023
When applying format changes to staged files, git-clang-format erroneously checks out all files in the index and thus may overwrite unstaged changes. Fixes #65643.
/cherry-pick 743659b |
/branch llvm/llvm-project-release-prs/issue65643 |
/pull-request llvm/llvm-project-release-prs#736 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
While running
git clang-format
I have come to a scenario where the script doesn't work as expected.How to reproduce
A
which require reformattingB
which don’t require reformattingB
which are actual changes (let’s say new function)git clang-format --staged
The effect:
A
which is the format change.B
are deleted. <- this is the wrong behaviorAdditional info
clang-format
and the script is 16.0.6If the changes that need formatting are staged in
B
and anything else is not staged inB
then thegit-clang-format
refuses to format and prints a message saying that there are unstaged changes.The text was updated successfully, but these errors were encountered: