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.34k stars 745 forks source link

strict repository indentation #2672

Closed hseuming closed 5 years ago

hseuming commented 5 years ago

Hi, My computing env is as follows:

OpenGrok: 1.1 JDK: openjdk version "1.8.0_191" OS: Ubuntu 18.04.1 LTS browser: Google Chrome Version 72.0.3626.81 (Official Build) (64-bit)

In order to demonstrate the problem I ran into, I've set up the following repos with Apache being a directory on my Ubuntu 18.04 box:

=================
Apache
   Apache/ant
   Apache/ivy
   Apache/tomcat

d3

jwt-scala
=================

However, I saw the following in {OpenGrok (PNG image attached):

=================
Apache   (linked to  --->  Apache/ant)
   Apache/ivy
   Apache/tomcat

d3

jwt-scala
=================

Is that expected?

Thanks

opengrok

tulinkry commented 5 years ago

I believe this is not directly expected however works as designed - the first repository of the project is treated as the main repository and all other repositories in a project are treated as subrepositories and displayed with a little margin.

tulinkry commented 5 years ago

So I believe when the project has more repositories, maybe we should display all of them with the margin. @vladak thoughts?

vladak commented 5 years ago

I think this works as designed. If the project directory itself is a repository and has more than 1 sub-repositories, the alternative would be to display this as:

Apache        -- empty URI
  Apache      -- repo URI
  Apache/ivy  -- repo URI
  ...

Not sure I like this, though.

ChristopheBordieu commented 5 years ago

Hi,

An alternative could be too to display:

Apache               --empty URI
  Apache/ant         -- repo URI
  Apache/ivy         -- repo URI
...

I vote for this one :-D (cf. my comment here).

hseuming commented 5 years ago

@tulinkry:

the first repository of the project is treated as the main repository and all other repositories in a project are treated as subrepositories

the "first" repo (in lexicographical order or whatnot) may not really be the "main" repo unless we tweak the original naming convention of some FLOSS projects when we clone them under SRC_ROOT

My personal preference is the same as that of @ChristopheBordieu:

   Apache                   -- empty URI
         Apache/ant         -- repo URI
         Apache/ivy         -- repo URI
         Apache/tomcat      -- repo URI
   ....

Anyway, thank you all for your input

tulinkry commented 5 years ago

I did a pull request for the new format.