Skip to content

Commit

Permalink
HistoryGuru: Skip history creation for defined directories
Browse files Browse the repository at this point in the history
If a project has an .opengrok_skip_history file, skip creating
it's historycache

Fixes oracle#652
  • Loading branch information
naseer authored and trondn committed Aug 26, 2013
1 parent 82d2d4f commit 17d95a6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OpenGrok
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ DefaultInstanceConfiguration()

# OPTIONAL: Ignore these patterns as names of files or directories
#IGNORE_PATTERNS="-i dummy"
# To ignore skipping just the history cache creation for a particular
# directory and all of it's subdirectories, touch an empty
# .opengrok_skip_history file at the root of that directory

# OPTIONAL: Enable Projects
# (Every directory in SRC_ROOT is considered a separate project)
Expand Down
5 changes: 5 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ by OpenGrok.

Note that OpenGrok ignores symbolic links.

If you want to skip indexing the history of a particular directory
(and all of it's subdirectories), you can touch .opengrok_skip_history at the root
of that directory


4.2 Using Opengrok wrapper script to create indexes
---------------------------------------------------

Expand Down
9 changes: 9 additions & 0 deletions src/org/opensolaris/opengrok/history/HistoryGuru.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ private void addRepositories(File[] files, Collection<RepositoryInfo> repos,
*/
private void addRepositories(File[] files, Collection<RepositoryInfo> repos,
IgnoredNames ignoredNames, boolean recursiveSearch, int depth) {
for (File file : files) {
Repository repository = null;
if (file.getName().equals(".opengrok_skip_history")) {
log.log(Level.INFO, "Skipping history cache creation for "
+ file.getParentFile().getAbsolutePath()
+ " and it's subdirectories");
return;
}
}
for (File file : files) {
Repository repository = null;
try {
Expand Down
1 change: 1 addition & 0 deletions src/org/opensolaris/opengrok/index/IgnoredNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public final class IgnoredNames extends Filter {
".sln",
".vsmdi",
".dll",
".opengrok_skip_history",
};

public IgnoredNames() {
Expand Down

0 comments on commit 17d95a6

Please sign in to comment.