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

Valid value "input" for git autocrlf is not handle properly in sanity check #738

Closed
frederickjh opened this issue Feb 25, 2020 · 2 comments

Comments

@frederickjh
Copy link
Contributor

After trying to install via the url piped directly to fish failed. I download the installer script and ran: ./install --help. Seeing that there was a "system readiness check" I then ran:

./install --check
Checking for a sane environment...

Seeing as that provided very little information I then tried:

./install --check --verbose
DEBUG: verbose turned on
Checking for a sane environment...
DEBUG: Command 'awk' is /usr/bin/gawk
DEBUG: Command 'basename' is /usr/bin/basename
DEBUG: Command 'cp' is /bin/cp
DEBUG: Command 'cut' is /usr/bin/cut
DEBUG: Command 'date' is /bin/date
DEBUG: Command 'dirname' is /usr/bin/dirname
DEBUG: Command 'env' is /usr/bin/env
DEBUG: Command 'fish' is /usr/bin/fish
DEBUG: Command 'fold' is /usr/bin/fold
DEBUG: Command 'head' is /usr/bin/head
DEBUG: Command 'mkdir' is /bin/mkdir
DEBUG: Command 'mv' is /bin/mv
DEBUG: Command 'readlink' is /bin/readlink
DEBUG: Command 'rm' is /bin/rm
DEBUG: Command 'sed' is /bin/sed
DEBUG: Command 'sort' is /usr/bin/sort
DEBUG: Command 'tar' is /bin/tar
DEBUG: Command 'tr' is /usr/bin/tr
DEBUG: Command 'which' is /bin/which
DEBUG: Checking for a sane 'head' implementation
DEBUG: Checking for a sane 'sort' implementation
DEBUG: Checking for a working AWK interpreter
DEBUG: Verifying Git implementation is not buggy Git for Windows
DEBUG: Verifying Git autocrlf is not enabled
fatal: bad numeric config value 'input' for 'core.autocrlf' in /home/fhenderson/.gitconfig: invalid unit

I then checked my setting for git core.autocrlf:

git config core.autocrlf                                                                                                     209ms  [Die Feb 25 15:46:56]
input

Checking the Git documentation for Formatting and Whitespace, core.autocrlf has three possible values: true, false and input.

Examing the code in install

oh-my-fish/bin/install

Lines 483 to 487 in b2d7a44

debug "Verifying Git autocrlf is not enabled"
if test (cmd git config --bool core.autocrlf; or echo false) = true
abort "Please disable core.autocrlf in your Git configuration."
end
end

we see that it is not handling the possible value input properly and this is what is aborting the install.

I believe that what should be tested for here is if the value of core.autocrlf is set to false with something like this:

 if test (cmd git config core.autocrlf) = false
    echo "Please disable core.autocrlf in your Git configuration."
  end

Thanks for looking into this!
Frederick


Environment report

I am trying to install a newer version after uninstalling a very old version and the install is failing, so omf is not installed.

$ omf doctor                                                                                                                           [Die Feb 25 15:26:28]
omf: command not found
Operating System: Ubuntu 16.04.6 LTS
Fish Version: 3.1.0
Oh My Fish Version: not yet reinstalled
Git version: 2.7.4
@frederickjh
Copy link
Contributor Author

I would be willing to work on a pull request for this and test it. Just let me know if what I propose above looks like I am headed in the correct direction with this fix.

@bobthecow
Copy link
Member

Yep, your assessment looks correct!

frederickjh added a commit to frederickjh/oh-my-fish that referenced this issue Mar 8, 2020
frederickjh added a commit to frederickjh/oh-my-fish that referenced this issue Mar 9, 2020
…k for what we do not want to see "false".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants