[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. The following fix should resolve this $ git diff git-clang-format diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format index 40e848d55a8c..c7e15eb7b483 100755 --- a/clang/tools/clang-format/git-clang-format

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. Just guessing but is this caused by the text at the bottom? There doesn’t seem to be a zero line change in the patch file —- 2.30.1 (Apple Git-130) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111273/new/

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-18 Thread Lang Hames via Phabricator via cfe-commits
lhames added a comment. Heads up -- I think I just hit an error due to this while formatting a local commit: % ./clang/tools/clang-format/git-clang-format HEAD~1 Assertion failed: (Line &&

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-08 Thread Zequan Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf93169226a29: [clang-format-diff] Fix missing formatting for zero length git diff lines (authored by zequanwu). Repository: rG LLVM Github

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-08 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 378291. zequanwu added a comment. Fix the same error in git-clang-format. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111273/new/ https://reviews.llvm.org/D111273 Files:

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-08 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. So this isn't just clang-format-diff.py but also all of `git clang-format` git add Analysis.cpp $ git clang-format clang-format did not modify any files This is bad because this is a way in which those using "git

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-08 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision. hans added a comment. This revision is now accepted and ready to land. lgtm If you want to look into it, I think having some kind of test for this script would be useful. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-07 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D111273#3047759 , @hans wrote: > Are there no tests for clang-format-diff.py? That seems unfortunate. No test for clang-format-diff.py. > Will this handle more nested cases, for example if the first line here is > deleted,

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-07 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment. Are there no tests for clang-format-diff.py? That seems unfortunate. Will this handle more nested cases, for example if the first line here is deleted, will we fix the indent of both "if (b)" and "c"? if (a) if (b) c; I worry that this might be a tricky

[PATCH] D111273: [clang-format-diff] Fix missing formatting for zero length git diff lines

2021-10-06 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added reviewers: rnk, phosek. zequanwu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If we only delete lines that are outer block statements (if, while, etc), clang-format-diff.py can't format the