opengrok

Opengrok can't ignore patterns


Opengrok is able to provide searching already, but it failed to ignore files, even IGNORE_PATTERNS is defined.

export IGNORE_PATTERNS="-i f:*.o -i f:*.out -i f:*.so -i f:*.class -i f:*.swp -i f:*.cache -i f:*.gitignore -i f:*.gitmodules -i f:*.project -i f:*.classpath -i f:*.log.* -i f:*.jar -i d:.git -i d:.settings -i d:target -i d:bin -i d:build -i d:gen -i d:test-output"

I already tried to remove data/ dir, and re-index, still can't ignore specified pattern.

The searching result still show items from *.log and *.class files.

Any idea?


@Update - solution

I am using opengrok-1.1-rc21, actually simply change env name to OPENGROK_IGNORE_PATTERNS solved the issue.

Thanks to @MarceloƁviladeOliveira's comment in below answer.


Solution

  • I'm not sure you can use the "f:" and "d:" to choose between files and directories (see update below) but you could try to use a "/" before the directories names.

    So you could, for example, try to replace:

    f:*.classpath => *.classpath
    d:.git        => */.git/*
    

    I was able to ignore all .test files and the test-dir directory executing:

    OPENGROK_CONFIGURATION=opengrok.conf OpenGrok index
    

    With a opengrok.conf file with this:

    ...
    IGNORE_PATTERNS="-i *.test -i */test-dir/*"
    

    UPDATE

    Actually the "f:" and "d:" modifiers can be used... the issue was the "IGNORE_PATTERNS" variable which was changed to "OPENGROK_IGNORE_PATTERNS" in OpenGrok v1.1.

    See more info here.