Skip to content

Commit 17d95a6

Browse files
naseertrondn
authored andcommitted
HistoryGuru: Skip history creation for defined directories
If a project has an .opengrok_skip_history file, skip creating it's historycache Fixes #652
1 parent 82d2d4f commit 17d95a6

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

OpenGrok

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ DefaultInstanceConfiguration()
212212

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

216219
# OPTIONAL: Enable Projects
217220
# (Every directory in SRC_ROOT is considered a separate project)

README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ by OpenGrok.
117117

118118
Note that OpenGrok ignores symbolic links.
119119

120+
If you want to skip indexing the history of a particular directory
121+
(and all of it's subdirectories), you can touch .opengrok_skip_history at the root
122+
of that directory
123+
124+
120125
4.2 Using Opengrok wrapper script to create indexes
121126
---------------------------------------------------
122127

src/org/opensolaris/opengrok/history/HistoryGuru.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ private void addRepositories(File[] files, Collection<RepositoryInfo> repos,
304304
*/
305305
private void addRepositories(File[] files, Collection<RepositoryInfo> repos,
306306
IgnoredNames ignoredNames, boolean recursiveSearch, int depth) {
307+
for (File file : files) {
308+
Repository repository = null;
309+
if (file.getName().equals(".opengrok_skip_history")) {
310+
log.log(Level.INFO, "Skipping history cache creation for "
311+
+ file.getParentFile().getAbsolutePath()
312+
+ " and it's subdirectories");
313+
return;
314+
}
315+
}
307316
for (File file : files) {
308317
Repository repository = null;
309318
try {

src/org/opensolaris/opengrok/index/IgnoredNames.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public final class IgnoredNames extends Filter {
7373
".sln",
7474
".vsmdi",
7575
".dll",
76+
".opengrok_skip_history",
7677
};
7778

7879
public IgnoredNames() {

0 commit comments

Comments
 (0)