Update scripts/lint-conflicts.sh script

There's two problems with the current script:

  1. 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 ...]
  2. 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 Sep 05, 2018 by Robert Speicher
Assignee Loading
Time tracking Loading