Skip to content

Commit e9c36d5

Browse files
committed
improve logging
1 parent bc0daf2 commit e9c36d5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryGuru.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.jetbrains.annotations.Nullable;
5050
import org.jetbrains.annotations.VisibleForTesting;
5151
import org.opengrok.indexer.configuration.CommandTimeoutType;
52+
import org.opengrok.indexer.configuration.Configuration;
5253
import org.opengrok.indexer.configuration.Configuration.RemoteSCM;
5354
import org.opengrok.indexer.configuration.OpenGrokThreadFactory;
5455
import org.opengrok.indexer.configuration.PathAccepter;
@@ -609,10 +610,18 @@ public boolean hasHistory(File file) {
609610
}
610611

611612
// This should return true for Annotate view.
612-
return ((env.getRemoteScmSupported() == RemoteSCM.ON)
613-
|| (env.getRemoteScmSupported() == RemoteSCM.UIONLY)
614-
|| (env.getRemoteScmSupported() == RemoteSCM.DIRBASED)
613+
Configuration.RemoteSCM globalRemoteSupport = env.getRemoteScmSupported();
614+
boolean remoteSupported = ((globalRemoteSupport == RemoteSCM.ON)
615+
|| (globalRemoteSupport == RemoteSCM.UIONLY)
616+
|| (globalRemoteSupport == RemoteSCM.DIRBASED)
615617
|| !repo.isRemote());
618+
619+
if (!remoteSupported) {
620+
LOGGER.log(Level.FINEST, "not eligible to display history for ''{0}'' as repository {1} is remote " +
621+
"and the global setting is {2}", new Object[]{file, repo, globalRemoteSupport});
622+
}
623+
624+
return remoteSupported;
616625
}
617626

618627
/**

0 commit comments

Comments
 (0)