0

Have a head scratcher that I cannot quite figure out.

In opengrok when you are looking at a file and turn on the annotate feature / link, you see columns for changeset history, search for this changelist, and the user id or email address of the submitter. My question is in regards to this last part, the user id or email address.

Right now the hyperlink points to ...

http://www.myserver.org/viewProfile.jspa?username=jsmith%40acme.com

How could one go about customizing this?

This is for opengrok with mercurial as well.

Thanks in advance.

2 Answers2

0

Looks like it is hard-coded ;(

https://github.com/OpenGrok/OpenGrok/blob/master/src/org/opensolaris/opengrok/configuration/Configuration.java#L227

So, probably the right way to do this is to provide your own Configuration implementation.

Another possible workaround is just to disable 'wrong' links -- they are not very useful in any case.. Something like this in source/default/style.css:

.blame .a { /* author name "column" (annotation) */
    text-align: center;
    pointer-events: none;
    cursor: default;
}

#revisions td:nth-child(4) {
    pointer-events: none;
    cursor: default;
}
Andrew Krasny
  • 71
  • 2
  • 4
0

The value can be configured via -B flag. https://github.com/OpenGrok/OpenGrok/blob/master/src/org/opensolaris/opengrok/index/CommandLineOptions.java#L77

If you are indexing with the 'OpenGrok' script file (the file you run when start indexing) you can edit it and add this option in CommonInvocation() function.

Here is a diff example of my change:

--- opengrok-0.12.1.5/bin/OpenGrok.orig    2016-02-18 19:16:31.504272867 +0200
+++ opengrok-0.12.1.5/bin/OpenGrok     2016-02-18 19:17:29.167968433 +0200
@@ -148,6 +148,7 @@
     # operating systems, if you have any reasonably generic
     # improvements please feel free to submit a patch.

+    MY_BASE_URL="http://myCompanyUrl.com?q="

     OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/var/opengrok}"

@@ -808,6 +809,7 @@
         ${CTAGS_OPTIONS_FILE:+-o} ${CTAGS_OPTIONS_FILE}                \
         ${OPENGROK_FLUSH_RAM_BUFFER_SIZE} ${SKIN} ${LEADING_WILDCARD}  \
         ${READ_XML_CONF}                                               \
+        -B ${MY_BASE_URL}                                              \
         "${@}"
 }
Amotz
  • 16
  • 1