From fb354cba05a71041775a03a3a26122e01b4782a1 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 4 Sep 2020 13:42:03 -0700 Subject: [PATCH] Remove .gitattributes and normalize line endings (#29792) Summary: The nested `.gitattributes` file in `packages/react-native-codegen/android/` caused some confusion on Linux and macOS, causing Git to show `packages/react-native-codegen/android/gradlew.bat` as modified (CRLF removed, LF added). Instead of relying on repo-local `.gitattributes` files to convert endings in the working directory, the files should be committed to source control with the correct line endings in the first place. There is no reason to convert LF endings in .sh and many other file to CRLF on Windows (maybe this was an issue a long time ago, but unless Notepad is used this won't be a problem for practically all modern editors). Also fixed the line endings of `scripts/launchPackager.bat` which was incorrectly committed as LF. ## Changelog [Internal] [Fixed] - Line endings and .gitattributes Pull Request resolved: https://github.com/facebook/react-native/pull/29792 Test Plan: Clone repo on Linux, macOS, and Windows, and make sure no modified files show up. Reviewed By: fkgozali Differential Revision: D23546135 Pulled By: mdvacca fbshipit-source-id: 1572fcb959212f212b137066f1aa66f0bb6e86c3 --- .gitattributes | 6 ----- .../android/.gitattributes | 6 ----- .../react-native-codegen/android/.gitignore | 5 ---- scripts/launchPackager.bat | 24 +++++++++---------- template/_gitattributes | 1 - 5 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 .gitattributes delete mode 100644 packages/react-native-codegen/android/.gitattributes delete mode 100644 packages/react-native-codegen/android/.gitignore delete mode 100644 template/_gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 8f9372e008985a..00000000000000 --- a/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# Force LF line endings for Bash scripts. On Windows the rest of the source -# files will typically have CR+LF endings (Git default on Windows), but Bash -# scripts need to have LF endings to work (under Cygwin), thus override to force -# that. -gradlew text eol=lf -*.sh text eol=lf diff --git a/packages/react-native-codegen/android/.gitattributes b/packages/react-native-codegen/android/.gitattributes deleted file mode 100644 index 00a51aff5e5a83..00000000000000 --- a/packages/react-native-codegen/android/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# These are explicitly windows files and should use crlf -*.bat text eol=crlf - diff --git a/packages/react-native-codegen/android/.gitignore b/packages/react-native-codegen/android/.gitignore deleted file mode 100644 index 1b6985c0094c8e..00000000000000 --- a/packages/react-native-codegen/android/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build diff --git a/scripts/launchPackager.bat b/scripts/launchPackager.bat index ce71959a16d046..aed322d7c530ce 100644 --- a/scripts/launchPackager.bat +++ b/scripts/launchPackager.bat @@ -1,12 +1,12 @@ -:: Copyright (c) Facebook, Inc. and its affiliates. -:: -:: This source code is licensed under the MIT license found in the -:: LICENSE file in the root directory of this source tree. - -@echo off -title Metro -call .packager.bat -cd ../../../ -node "%~dp0..\cli.js" start -pause -exit +:: Copyright (c) Facebook, Inc. and its affiliates. +:: +:: This source code is licensed under the MIT license found in the +:: LICENSE file in the root directory of this source tree. + +@echo off +title Metro +call .packager.bat +cd ../../../ +node "%~dp0..\cli.js" start +pause +exit diff --git a/template/_gitattributes b/template/_gitattributes deleted file mode 100644 index d42ff18354df61..00000000000000 --- a/template/_gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text