1

I am new to Doxygen and recently came across an issue on how to exclude .git folder from being searched by Doxygen.

Neither

EXCLUDE = .git

nor

EXCLUDE_PATTERNS = */.git/*

work.

This does seem like an ordinary thing, having a git repository with doxyfile for the source code, in the same folder. So am I missing something.

EDIT: doxygen -x Doxyfile

# Difference with default Doxyfile 1.9.7 (9de8406f02f007519c5d51e67602de9c7ce85c2f)
INPUT                  = /rootfolder
RECURSIVE              = YES
EXCLUDE                = .git
EXCLUDE_PATTERNS       = */.git/*
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = YES
PREDEFINED             = PYTHON=1

EDIT2: Okay so I seem to have figured it out. Problem was in

EXCLUDE = .git

because according to post from @VonC's answer

More precisely, adding a directory to the EXCLUDE directive causes everything in that directory to be searched.

So simply leaving EXCLUDE directive to be empty solved the issue.

Marhos
  • 11
  • 2
  • Which version of doxygen are you using? Which OS are you using? What are you settings in the doxygen configuration file different from the default settings (i.e. `doxygen -x Doxyfile`). Please add this information into your question. – albert Feb 26 '23 at 08:50
  • Information added. @albert – Marhos Feb 27 '23 at 14:54

1 Answers1

0

If the EXCLUDE_PATTERNS (from the official documentation) somehow does not work, the alternative is to:


But first, as seen here, check if you have set INPUT properly, as documented in "My file with a custom extension is not parsed (properly) (anymore)".

Doxygen only parses files that are specified as input (via the INPUT tag) and that match a specified extension (mentioned in FILE_PATTERNS)

The list of files is then reduced by excluding files listed as EXCLUDE or files that match the patterns set by EXCLUDE_PATTERNS.

The OP Marhos confirms that EXCLUDE = .git (which causes the .git/ folder content to be searched) is the issue.

The EXCLUDE tag can be used to specify files and/or directories that should be excluded from the INPUT source files.
This way you can easily exclude a subdirectory from a directory tree whose root is specified with the INPUT tag.

It is best to leave it empty, and use only EXCLUDE_PATTERNS:

If the value of the INPUT tag contains directories, you can use the EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude certain files from those directories.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Without knowing the settings from OP I think the suggestion of moving `.git` and setting the `GIT_DIR` environment variable is not a good suggestion. I looks a bit like OP starting doxygen in the base directory of the repository which is never a good idea. – albert Feb 26 '23 at 08:55
  • @albert I agree. I will wait for any update on the original post. – VonC Feb 26 '23 at 12:52
  • What is a good practice on where to start the doxygen base directory in. – Marhos Feb 27 '23 at 15:00
  • @Marhos Did you check your INPUT setting? – VonC Feb 27 '23 at 15:02
  • My `INPUT` setting is set to rootfolder, that is (using wsl), `/mnt/d/.../project`. @VonC – Marhos Feb 27 '23 at 15:10
  • @Marhos Good catch with the `EXCLUDE` configuration. I have edited the answer to include its documentation. – VonC Feb 27 '23 at 19:45