Граф коммитов

3 Коммитов

Автор SHA1 Сообщение Дата
Héctor Ramos 10c39847a7 Re-sync with internal repository 2020-03-13 17:43:04 -07:00
Pavlos Vinieratos 5198978f2a Don't mess with Windows line endings (#28274)
Summary:
During some rc releases we have seen the file `gradlew.bat` get diffs from release to release, and sometimes the diff is nothing, except some script messing with the line endings of that file.

According to [this](https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings#example) and my own experiments using `unix2dos` and `dos2unix` to swap the line endings of that file, this change fixes this problem.
We specify all the `.bat` files should have the Windows line endings.

## Changelog

[General] [Fixed] - Specify line endings of `.bat` files for Windows in `.gitattributes`
Pull Request resolved: https://github.com/facebook/react-native/pull/28274

Test Plan:
To assist with the test, you can use `brew install unix2dos`.

- Init a new project or use an existing one.
- Make sure in your `.gitattributes` of the project and of the user (home dir or `.config/git/attributes` don't have anything about `.bat` files, or `* text=auto`.
- Run `unix2dos ./android/gradlew.bat`.
- Check git status.
- Run `dos2unix ./android/gradlew.bat`.
- Check git status.
- You will notice that the changes when swapping around are the whole file changed.

- Using the changes in this PR, and doing the above, the git status will be no changes, as it should be. The line changes stay Windows-style.

Reviewed By: cpojer

Differential Revision: D20369235

Pulled By: TheSavior

fbshipit-source-id: 4bb6e9f46caecd36211834c7dc3f0e2e64272862
2020-03-10 14:11:23 -07:00
Bret Johnson ea70525744 Added a .gitattributes file, ensuring that Bash script source files (gradlew and
*.sh) have normal Unix LF line endings even on Windows.  This change is needed
so gradlew, packager.sh, and other Bash scripts can run on Windows (under cygwin).
On Windows the rest of the source files will typically have CR+LF endings (Git
default), but Bash scripts need to have LF endings to work, thus this override
to force that.
2015-10-13 23:10:39 -04:00