[PATCH] D51444: [git-llvm] Fix eol conversion on Windows for explicit CRLF files

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 14:06:46 PDT 2018


rnk added inline comments.


================
Comment at: llvm/utils/git-svn/git-llvm:242
                 crlf_files.append(f)
-    # Reformat all files with native SVN line endings to Unix format. SVN knows
-    # files with native line endings are text files. It will commit just the
-    # diff, and not a mass line ending change.
-    shell(['dos2unix', '-q'] + crlf_files, cwd=svn_sr_path)
+    if len(crlf_files) > 0:
+        # Reformat all files with native/CRLF SVN line endings to Unix format. SVN knows
----------------
`if crlf_files:` is more python-y


================
Comment at: llvm/utils/git-svn/git-llvm:248
+            # GnuWin32 dos2unix doesn't have the -q option.
+            shell(['dos2unix', '-q'] + crlf_files, die_on_failure=False, cwd=svn_sr_path)
+        except RuntimeError:
----------------
-q is for quiet. My goal was to suppress all warning output. Instead, you could probably do:
  shell(['dos2unix'] + crlf_files, ignore_errors=True)

I don't remember what warnings I saw, but they were annoying.


https://reviews.llvm.org/D51444





More information about the llvm-commits mailing list