oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

Translate opengrok code links to github code links or other #3180

Open nitrocode opened 4 years ago

nitrocode commented 4 years ago

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.

tulinkry commented 4 years ago

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.

vladak commented 4 years ago

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.

harrisric commented 1 year ago

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).