Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup .gitattributes for eol normalization #429

Merged
merged 1 commit into from Dec 7, 2012

Conversation

Projects
None yet
2 participants
@ryenus
Copy link
Contributor

ryenus commented Dec 6, 2012

This will work automatically for future commits.

For existing files, we have to manually normalize
them once and only once, with following command:

find . \( -path './.git' -o -path './build*' -o \
-path './src_gen' \) -prune -o -type f -print |\
xargs dos2unix

One caveat of dos2unix is, even though it claims
by default only convert line breaks and skip
binary files, it actually depends, e.g., some
UTF-16 files could be messed up; and the BOM in
some UTF-8 files could be removed unexpectedly.

Therefore, after running the above command, make
sure to use git diff to see if there's any such
kind of unexpected change, and those files can be
restored via git checkout.

Setup .gitattributes for eol normalization
This will work automatically for future commits.

For existing files, we have to manually normalize
them once and only once, with following command:

find . \( -path './.git' -o -path './build*' -o \
-path './src_gen' \) -prune -o -type f -print |\
xargs dos2unix

One caveat of dos2unix is, even though it claims
by default only convert line breaks and skip
binary files, it actually depends, e.g., some
UTF-16 files could be messed up; and the BOM in
some UTF-8 files could be removed unexpectedly.

Therefore, after running the above command, make
sure to use git diff to see if there's any such
kind of unexpected change, and those files can be
restored via git checkout.
@ryenus

This comment has been minimized.

Copy link
Contributor Author

ryenus commented Dec 6, 2012

@headius: in your commit which removed the .gitattributes file, you mentioned that

Author: Charles Oliver Nutter headius@headius.com
Date: 2012-08-06 12:00:30 -0500

Remove .gitattributes

Unfortunately, due to some crlf line endings in MRI's test suite
this was causing a few files to be constantly rewritten. The
rewritten files show up as modified and can't be reverted because
reverting causes them to get rewritten again. We'll need a
a different solution.

Could you please let me know which files are problematic?

Anyway, I think the problem should be gone because now I've normalized all existing problematic files (should have done this with my initial commit). With this supplemental modification, I've successfully applied the same change to a dozen of intranet projects and everything is alright.

Also, as for JRuby, I've adjusted the .gitattributes file accordingly to work with a few JRuby specific files.

With this new commit the problems mentioned in your previous commit should be gone. Hopefully you can give it a try and let me know the result.

Thanks

@headius

This comment has been minimized.

Copy link
Member

headius commented Dec 7, 2012

We'll give it a shot again. I remember it was some test files, but I don't remember specifics.

headius added a commit that referenced this pull request Dec 7, 2012

Merge pull request #429 from ryenus/norm-eol
Setup .gitattributes for eol normalization

@headius headius merged commit 37fe6d2 into jruby:master Dec 7, 2012

1 check passed

default The Travis build passed
Details

eregon added a commit that referenced this pull request Apr 28, 2017

Squashed 'spec/ruby/' changes from 2e2057a..0db663b
0db663b Fixed Math.log2 for huge Bignums.
bc52723 Added {Bignum, Fixnum}.bit_length.
aad92e8 Numeric timezone may not be bad
1eb3d2f Add specs for rb_define_module
8e8b5fd Fix SHELL env var passing
f7ec5b7 Hide $IGNORECASE warnings
344bd8d Use ruby_exe to reliably spawn a subprocess
946abd5 Remove spec which only works before MRI 2.4.0
e6665ae Add a spec for syntax errors in the script file and -e
497931b Add new method spec with mixed parameter types.
4042b46 Add large number example to String#% binary number format
61acec4 Add String#% %p example with string argument
9a8fd6d Add library specs for the English module
ed5046a Updated incomplete String#encoding spec.
279d4e0 Add instance_variable_defined? example testing various types where variable is not defined
b89895d Fix typo in spec description
4fefa64 Specs for true and false values being truthy and falsey in C
1d8bcf0 Add another Time#zone bad zone example
6af9b04 Add Module#alias_method spec to assert that aliased methods are == to eachother
b2c2eeb Add Kernel#eval negative line number spec
5c0bd7b Add BasicObject#instance_eval example with negative line number
26d35a1 Spec that a splatted Array received in a rest argument is copied
4a8d694 Only use literal values in the expected value
4af8050 Add splat example where splatted array is modified by another argument
1274e6a Add spec to update backtrace array in place
11db149 It starts to look like something to unescape but it ends prematurely.  Do not expand (nor crash)
c9e7f56 Allow .jar as extension of provided features
c1f379e Reduce sleep time in Process.daemon specs
24282dc Method#curry_spec: Be more explicit with simpler syntax
ec31710 Move methods used only once closer to their usage
1f537ff Move fixture closer to its only usage
ca345d3 Revert "Kerenel#warn no longer splats an array in 2.5 (#382)" (#429)
7beafc0 Handle warnings in MOdule#attr spec
b79cf54 Concurrent requires show erroneous circular warnings
acb27a7 Expect warnings for circular require
c3256dc Fix commented warning net/http specs
897e9b4 No need to save/restore $VERBOSE when using the complain matcher
416ab81 2.5 no longer rescue exceptions of Integer#step to rethrow them as TypeError
f125a5d Numeric comparison operators no longer rescue exceptions
14bd5a4 Fix a few issues detected with $VERBOSE = true warnings
b53aa1b internal methods are not specs
7190a66 Remove duplicate specs
4753368 Fix some variables which were not availble for specdocs
bd885a6 Fix version-dependent warnings
26d13c0 Use the argv helper in getoptlong specs
3ba4551 Fix warnings in IO spec
a799f55 Remove continuation specs, continuation is obsolete since 2.2
328c7d8 Fix all warnings
8a491a9 Fix warnings in C-API specs
6227caa Fix remaining warnings in language specs
729a0ec Fix a few warnings in language
ee5b6a0 fix warning
863c8ac Expect circular argument warnings
eeef0e7 Fix class variable warnings in langauge specs
ccaf342 Fix remaining warnings in core
388adda Fix Kernel#=== spec
1ac4d2a Expect warnings from top-level class vars
f327217 Add expectations for argument + block warnings
1a42389 Add expectations for Ignoring encoding parameter warnings
dc2fd40 Fix a few more constant redefined warnings
4756e8d Avoid 2 already initialized constant warnings
faaf5ab Use local variables instead of constants in define_method spec
8341bb2 Catch warning in deprecate_constant spec
3940632 Remove unused constant
4280c78 Use Dir.chdir directly instead of relying on ruby_exe
4b9a0f3 Wrap a few warnings as complain matchers
50357ca Replace deprecated Enumerator.new(obj) with obj.to_enum
b416c79 Remove deprecated usage of $KCODE in specs
b37650b Inline MSpec helper used only twice in the same file
579055b Avoid be_computed_by_function
8fea4ed Simply perform the action over using weird MSpec helpers
735ee77 Unshare Process#spawn and Process#exec specs
0a56f79 Avoid running #exec-related specs 3 times
5ca04db Avoid running #spawn-related specs 3 times
fd91fee Use the full bug version Range as AppVeyor uses an older 2.3.3 Ruby
7b0bf1a Reintroduce bug guard as 2.4.1 is not available on Travis OS X yet
7bbadd1 Update versions
5bb0536 The bug has been fixed in all latest 2.x releases
8ca440d Add spec for identity of String literals in a compare_by_identity Hash
c6704df Opal strings are always frozen, avoid dup & clone
556a6db Also exclude AIX from log specs as it was before
9266dc7 Exclude Solaris from Syslog specs as it was before
fead51e Fix platform guard
44c0278 Simplify platform_is os: VALUE to just platform_is VALUE as they are the same now
5a17f65 platform guard requires OS name list, not an array
cd7e2f7 Fix platform guard in Float#round spec
c698d12 Merge pull request #426 from ruby/removed-deprecated-mathn
49cdead Ignored mathn examples
27080f0 Move TTY checks inside the example
c766f34 Remove unneeded guard
bc9272e Remove the last not_supported_on :jruby
f119ab6 Remove not_supported_on which can be replaced by tags
1f72098 Remove unneeded not_supported_on guard
f73cc7e Remove bad not_supported_on guards
ab97f67 Remove bad not_supported_on guards
f5764a5 Fix references to removed guards and use generic text instead
7279501 Remove unused require
f1e34eb Remove useless requires to mspec helpers already loaded
39a43e9 Remove useless require
47d5757 Inline the single usage of the home_directory helper
c8bb8f0 Remove useless before/after in Dir.home spec
9d8e406 Simplify expectation as it only tests on non-Windows
1bdfcd5 Use Dir.home in File.expand_path spec
6b1764b Just use `hostname` to get the hostname
ce16689 Use standard File::NULL over mspec helper
196d2bf Remove process_is_foreground guards
a22149f Merge pull request #425 from ruby/ignored-deprecated-extensions
5397086 Ignored mathn/{complex,rational} examples. These are deprecated from Ruby 2.5
520200a Revert "Avoid using #fork in Process#wait specs"
6fe19cb Add specs for Hash#dig with default
a12d209 Require date (#423)
cdbc5f0 String#crypt with NUL (#420)
aee1fad Merge branch 'nobu-bug/psych-update'
6357533 Picked YAML.load_stream example from #418
83bbd45 Merge pull request #417 from hsbt/fixed-spec-fail-for-psych
1a952f5 Follow psych-3.0.0.beta1
18efd61 Ignored deprecated methods of psych-3.0.0.beta1 with Ruby 2.5.0
a488ce5 TypedData_Get_Struct unwraps data for a parent type
4bbfa0c Refactor httpgenericrequest/exec_spec to use an actual Net::BufferedIO
72273d3 Remove old guards testing for Ruby < 2.2
1a28138 Remove old 2.1 or < 2.2 guards in C-API specs
e4763d5 Remove Logger::Application specs which no longer exist in Ruby 2.2+
60ccbba Drop support for Ruby 2.1
6686326 An invalid timezone has a non-zero offset on AIX
96ba5d5 Add 2.2 guard for Etc.nprocessors, 2.1 is not yet removed from CI
3b8d553 Add spec for Etc.nprocessors
8fd7a69 Remove files with no specs
2829346 rb_ary_store raises an error if array is frozen
e1fb7b4 Fix typo
42c1320 Add a spec for rb_ary_new_from_values
9ba7adb Add specs for rb_ary_new_capa
825c0a0 Add a spec for rb_struct_members
89f4e62 Use have_constant matcher rather than #const_defined?
320b4fb remove #sort since Struct.members guarantees the order
ca6957b Add specs for rb_struct_define_under
5b0d3f8 Fix typo in spec method being tested
cb1b38e rb_struct_aset raises an error if struct is frozen
cab4987 rb_struct_aset raises an error if index is out of range
64f8bcc rb_struct_aref raises an error if index is out of range
e4db1d3 Add specs for rb_struct_define
af5412d Add specs for rb_struct_s_members
ecc868d Update to 2.3.4
4207e0e Symbol#hash was fixed in 2.3.4
d6ade33 Fix inaccurate description of a spec in string_times
4aed560 Revert "Use fixnum_max+1 to mean "not fitting into a Fixnum""
a4e6958 Use fixnum_max+1 to mean "not fitting into a Fixnum"
a5e707a Use fixnum_max helper
582eed5 Share tests between String#* and rb_str_times
fa4e6b2 Add specs for rb_str_times
9c73e8b Specs for three initial vulnerabilities
25aa763 Add a spec for rb_String (#395)
0adc519 Add specs for rb_ary_rotate
03e3fba Add specs for rb_ary_cat
9078f37 Add a spec for rb_Hash
7847fa8 Update ruby_bug guards

git-subtree-dir: spec/ruby
git-subtree-split: 0db663be26db58348eb1cf2b2c4af6a2eca005f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.