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

[OS X] git reports changes not staged for commit in newly cloned repository #125

Closed
otaran opened this issue Nov 30, 2015 · 2 comments

Comments

@otaran
Copy link
Contributor

commented Nov 30, 2015

Steps To Reproduce

  1. git clone https://github.com/skvadrik/re2c.git
  2. cd re2c
  3. git status

Expected Result

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

Actual Result

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   re2c/test/ctx.S.c
    modified:   re2c/test/scanner.S.c

no changes added to commit (use "git add" and/or "git commit -a")

Notes

Reproducible with re2c version 0.15.2.

OS: Apple OS X El Capitan (10.11.1)
Developer Tools: Xcode 7.1.1 (7B1005)

$ git --version
git version 2.6.3

This issue is caused by files ctx.S.c and scanner.S.c which have counterparts ctx.s.c and scanner.s.c (note case of s letter):

$ git ls-tree HEAD re2c/test/ | grep [/]ctx[.]
100644 blob 6f64dcce50309afc24a81bab1c4c72fd3f8992ee    re2c/test/ctx.S.c
100644 blob 802df5a34d39465b48ca39a757cf23ad307851a5    re2c/test/ctx.S.re
100644 blob 08a50810630f1829fd1027257a48563c03c3c356    re2c/test/ctx.b.c
100644 blob 802df5a34d39465b48ca39a757cf23ad307851a5    re2c/test/ctx.b.re
100644 blob 198d5aa09fe52cd3ec03aa58b68ce895dc46fe29    re2c/test/ctx.c
100644 blob 802df5a34d39465b48ca39a757cf23ad307851a5    re2c/test/ctx.re
100644 blob d2798d4468e29d167a2d97f41e9ad63686c4c282    re2c/test/ctx.s.c
100644 blob 802df5a34d39465b48ca39a757cf23ad307851a5    re2c/test/ctx.s.re
$ git ls-tree HEAD re2c/test/ | grep [/]scanner[.]
100644 blob 6296a41971513cc4ddb83fa0408b37ff5689a301    re2c/test/scanner.S.c
100644 blob 1fd5221dd1a2c4f66e71f26a4c64d1261826e9b6    re2c/test/scanner.S.re
100644 blob 362fd45580b753422c19e7163ad3463cedb01c82    re2c/test/scanner.c
100644 blob 47339ccbd184f7d2fd15dc8af1b2a5ea7cb74189    re2c/test/scanner.fs.c
100644 blob 9a26eba70f97080933cfe1b373069d88fcb7f670    re2c/test/scanner.fs.re
100644 blob 1fd5221dd1a2c4f66e71f26a4c64d1261826e9b6    re2c/test/scanner.re
100644 blob 0493dd948947e3af5700e67f791f5c69ad030819    re2c/test/scanner.s.c
100644 blob 1fd5221dd1a2c4f66e71f26a4c64d1261826e9b6    re2c/test/scanner.s.re

By default OS X comes with case-insensitive HFS+ file system, that is why git reports wrong status.

@skvadrik skvadrik added this to the 0.15.3 milestone Nov 30, 2015

@skvadrik skvadrik self-assigned this Nov 30, 2015

skvadrik added a commit that referenced this issue Nov 30, 2015

Renamed tests that contained uppercase letters in file extension.
We use file extensions to encode re2c options.
Some (short) options are uppercase letters: e.g. '-D', '-F', '-S'.
There also short options for the same lowercase letters: '-d', '-f', '-s'.
This can cause filename collisions on platforms with case-insensitive
file extensions (e.g. Windows and OS X).

See bud #125: "[OS X] git reports changes not staged for commit
in newly cloned repository".

Fix: use long versions for options that uppercase options.
Disallowed uppercase options in 'run_tests.sh'.
@skvadrik

This comment has been minimized.

Copy link
Owner

commented Nov 30, 2015

True!

The same issue is on Windows. Fixed by renaming all tests to use lowercase letters only (long opt analogues of uppercase short opts), see this commit: 06fa1d8

I'm glad you noticed the problem. :)

@otaran

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2015

👍

@otaran otaran closed this Nov 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.