How to ignore directories in an OpenGrok index?

I am trying to configure OpenGrok to search through several GB of code, mainly Java and Python. I am using opengrok-0.12.1/bin/OpenGrok index $SRC_ROOT to create an index. I see that it indexes Java "target" and Python ".tox" directories that I don't need.

I searched the Internet and found the same question in many forums, and the answer was to use -i. I tried using this parameter with both the OpenGrok script shell and opengrok.jar, but all I get is a help message (because the command line options were apparently incorrect).

Could you give me an example of a command to create indexes that ignore specific directories?

+5
source share
1 answer

The solution is to use the -i flag. The best way to do this is to create a .conf file. For example, I have the following file defined as opengrok.conf :

 OPENGROK_APP_SERVER=Tomcat OPENGROK_TOMCAT_BASE=/usr/local/Cellar/tomcat/8.0.21/libexec OPENGROK_SCAN_DEPTH=4 OPENGROK_VERBOSE=yes OPENGROK_PROGRESS=yes IGNORE_PATTERNS="-if:foo.txt -i *.bar d:target -id:.tox" 

And start indexing using: OPENGROK_CONFIGURATION=opengrok.conf ./OpenGrok index $SRC_ROOT

It ignores indexing the foo.txt file, all files matching the *.bar pattern, and all files in directories named target or .tox .

Edit Credits: mrenaud , pcas

+8
source

Source: https://habr.com/ru/post/1215191/


All Articles