opengrok

how to change the email link in the annotate section of opengrok


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.


Solution

  • 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}                                              \
             "${@}"
     }