Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Project structure issue (inside a repo)

pgorodyansky
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 23, 2020

Wanted to see, in my branch, the top level folders only (project structure) but because I have only 1 sub-folder in some of them (see example below), I see that "glue" effect :-( - how to fix that?
If there are more than one sub-folder in a folder then it looks Ok (as Top1 and Top3 below)

Top1
Top2/<single sub-folder name>
Top3
Top4/<single sub-folder name>

 

----------------------

Note. There is a solution for similar issue in IntelliJ - may be it will be helpful?
When I open same project in IntelliJ (where folders and sub-folders are "packages") I initially saw the same "bad looking" project structure, but then found the solution and now I have clean/normal project structure in IntelliJ:

"Create non-flat packages":
'In the project pane, click the gear in the top right corner, and un-select "compact empty middle packages".'
https://stackoverflow.com/questions/36323553/create-non-flat-java-packages-in-intellij/36334297#36334297

1 answer

1 accepted

0 votes
Answer accepted
Evan Slaughter
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 5, 2020

Hi @pgorodyansky,

This behavior is by design, as it is a feature of Bitbucket to 'collapse' directories which contain only a single subdirectory into a single composite directory.

For example, consider the following repository layout (which is very common for Java projects using Maven):


src/
main/
java/
com/
atlassian/
bitbucket/
comment/
CommentService.java
repository/
RepositoryService.java
test/
java/
com/
atlassian/
bitbucket/
SomeTest.java

 

When listing src, both main and test each contain only a single subdirectory, which itself contains only a single subdirectory. That repeats for several layers of nesting. Without collapsing, navigating the directory structure would require clicking through several layers, with each layer requiring a server roundtrip to load the next. Both of these, combined, would lead to a great deal of annoyance for the user as well as increased load on the server as it handles each individual call.

While there's no form of configuration value or toggle to prevent this functionality, it's unlikely that this would be implemented - as any use case for not completing this directory collapse is usually something better handled by alternative solutions such as using something like git submodules to split out multiple 'projects' within a currently monolithic repository.

Hope this helps!

Thanks,

Evan Slaughter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events