git-clang-format does not format files with spaces in their path.
% git diff -p -U0 diff --git a/Test/Application/AppDelegate.m b/Test/Application/AppDelegate.m index 8bdd8b4..3effa19 100644 --- a/Test/Application/AppDelegate.m +++ b/Test/Application/AppDelegate.m @@ -17 +17,2 @@ @implementation AppDelegate -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ diff --git a/Test/Main Window/MainWindowController.m b/Test/Main Window/MainWindowController.m index df56059..49e1a9f 100644 --- a/Test/Main Window/MainWindowController.m +++ b/Test/Main Window/MainWindowController.m @@ -16 +16,2 @@ @implementation MainWindowController -- (void)windowDidLoad { +- (void)windowDidLoad +{
Result without the patch:
% git-clang-format -v
Ignoring changes in the following files (wrong extension or symlink):
Test/Main Window/MainWindowController.m
Running clang-format on the following files:
Test/Application/AppDelegate.m
old tree: 9cbacaf7a33dd4184bdc46ae93c6295cfef56030
new tree: 2a60aca2e1252612dd07032151c32536fcda6758
changed files:
Test/Application/AppDelegate.mResult with the patch:
% git-clang-format -v
Running clang-format on the following files:
Test/Application/AppDelegate.m
Test/Main Window/MainWindowController.m
old tree: a623751696b8d05e7a1a82b4e00aad4dbe089d53
new tree: e47d8134d0626aee02b0b7e840a9b49379b752d9
changed files:
Test/Application/AppDelegate.m
Test/Main Window/MainWindowController.mThe issue is not the space itself, but the tab character appended to the path (Test/Main Window/MainWindowController.m\t) by git-diff.
This has been reported before at https://bugs.llvm.org/show_bug.cgi?id=28654.