Skip to content

Linux Users Unable to Commit #202

@scrasmussen

Description

@scrasmussen

The ends_with_newline() function in developer-scripts/git-hooks/pre-commit produces an error when being called from a linux machine.

function ends_with_newline() {
    test ! -s "$1" || test $(tail -r -c1 "$1" | xxd -ps) = "0a"
}

The error reported is tail: invalid option -- 'r'. The linux tail does not have a -r option while the osx tail does. The function is only checking the last character so I belief it doesn't matter if the tail output is in reverse order. I think this issue can be fixed by simply removing the -r option.

Reproducing the error should be possible by

  1. use linux
  2. configuring your local repository with the whitespace settings by running ./developer-scripts/setup-git.sh
  3. attempting to commit a file.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions