[PATCH] D126365: [git-clang-format] Stop ignoring changes for files with space in path

2022-08-20 Thread Eitot via Phabricator via cfe-commits
Eitot added a comment.

In D126365#3565891 , @curdeius wrote:

> @Eitot, do you need help landing this?

I do need help. Could someone land this for me?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126365/new/

https://reviews.llvm.org/D126365

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126365: [clang-format] Stop ignoring changes for files with space in path

2022-05-25 Thread Eitot via Phabricator via cfe-commits
Eitot created this revision.
Eitot added a project: clang-format.
Herald added a project: All.
Eitot requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

`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
  +{



  % 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.m

The 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.

Resolves https://github.com/llvm/llvm-project/issues/29028#issue-1076357057


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126365

Files:
  clang/tools/clang-format/git-clang-format


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -345,7 +345,7 @@
 line = convert_string(line)
 match = re.search(r'^\+\+\+\ [^/]+/(.*)', line)
 if match:
-  filename = match.group(1).rstrip('\r\n')
+  filename = match.group(1).rstrip('\r\n\t')
 match = re.search(r'^@@ -[0-9,]+ \+(\d+)(,(\d+))?', line)
 if match:
   start_line = int(match.group(1))


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -345,7 +345,7 @@
 line = convert_string(line)
 match = re.search(r'^\+\+\+\ [^/]+/(.*)', line)
 if match:
-  filename = match.group(1).rstrip('\r\n')
+  filename = match.group(1).rstrip('\r\n\t')
 match = re.search(r'^@@ -[0-9,]+ \+(\d+)(,(\d+))?', line)
 if match:
   start_line = int(match.group(1))
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126365: [git-clang-format] Stop ignoring changes for files with space in path

2022-05-25 Thread Eitot via Phabricator via cfe-commits
Eitot added a comment.

In D126365#3536736 , @curdeius wrote:

> Would it be possible to add a test please?

Could you tell me what kind of test you would like me to add? I have edited the 
description above to include my result. I can add a basic shell script to set 
up a git repo and a few test files to illustrate the problem, if that is what 
you have in mind?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126365/new/

https://reviews.llvm.org/D126365

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126365: [git-clang-format] Stop ignoring changes for files with space in path

2022-05-26 Thread Eitot via Phabricator via cfe-commits
Eitot updated this revision to Diff 432221.
Eitot added a comment.

I have uploaded a complete diff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126365/new/

https://reviews.llvm.org/D126365

Files:
  clang/tools/clang-format/git-clang-format


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -345,7 +345,7 @@
 line = convert_string(line)
 match = re.search(r'^\+\+\+\ [^/]+/(.*)', line)
 if match:
-  filename = match.group(1).rstrip('\r\n')
+  filename = match.group(1).rstrip('\r\n\t')
 match = re.search(r'^@@ -[0-9,]+ \+(\d+)(,(\d+))?', line)
 if match:
   start_line = int(match.group(1))


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -345,7 +345,7 @@
 line = convert_string(line)
 match = re.search(r'^\+\+\+\ [^/]+/(.*)', line)
 if match:
-  filename = match.group(1).rstrip('\r\n')
+  filename = match.group(1).rstrip('\r\n\t')
 match = re.search(r'^@@ -[0-9,]+ \+(\d+)(,(\d+))?', line)
 if match:
   start_line = int(match.group(1))
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits