opengrok icon indicating copy to clipboard operation
opengrok copied to clipboard

Translate opengrok code links to github code links or other

Open nitrocode opened this issue 5 years ago • 3 comments

Interesting use case here.

We have opengrok and devs appreciate the opengrok search over GitHub. Once they have performed their search, they have the opengrok link to the specific entry in the code but they prefer the GitHub code link.

We were wondering how easy would it be to add a link next to each line of code to get the GitHub equivalent link to the code?

Thanks.

nitrocode avatar Aug 01 '20 16:08 nitrocode

Most of the opengrok links are queries to opengrok and that would be fairly hard to translate to github search query, however if you're interested to jump to the particular file or line that could be pretty simple to do with

  1. Greasemonkey and (perhaps simple) custom javascript on top of opengrok
  2. There could be a support in the intelligence window in OpenGrok (it allows you to search the symbol on google for example)

The problem with general solution with changed links is also that opengrok allows you to "grok" the source code easily - navigate through files via definitions/symbols/paths very quickly. I know that github also has some kind of "definition query" for some source code languages but the feature is rather poor when you compare it with the efficiency of opengrok. So once you escape to github, your options to navigate further is limited.

tulinkry avatar Aug 03 '20 06:08 tulinkry

Given how widespread Github use is it would possibly to make sense to add the capability to the Intelligence window. Perhaps also time to think about how to make the window content extensible in generic way.

vladak avatar Aug 18 '20 16:08 vladak

I also have an interest in this for a similar use-case - however I agree that its pretty simple to create a javascript bookmark that redirects from what I'm looking at in grok to the equivalent code in our source system (and indeed I've done exactly this).

harrisric avatar Feb 23 '23 12:02 harrisric