Update scripts/lint-conflicts.sh script
There's two problems with the current script:
-
It's not compatible with the BSD version of
grep
that ships with OSX:gitlab-ee master % ./scripts/lint-conflicts.sh grep: invalid option -- z usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...]
-
It's missing results sometimes:
gitlab-ee master % ./scripts/lint-conflicts.sh gitlab-ee master % echo $? 0
vs.
gitlab-ee master % g grep -E '^<<<<<<< HEAD' -- '*.haml' '*.js' '*.rb' app/views/projects/settings/repository/show.html.haml:6:<<<<<<< HEAD
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7252 included this change and was apparently missed by the lint, necessitating https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7253.
I think the git grep
command I used above should cover our needs and be platform agnostic. It's also faster and simpler.
Edited by Robert Speicher