zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
607 stars 76 forks source link

Submodules showing branch name of parent project #328

Closed timo-rohwedder closed 2 years ago

timo-rohwedder commented 3 years ago

Hi!

I'm not sure if this is a bug, a misconfiguration or something special in my individual setup. This happens since I updated to IntelliJ 2020.2. I am using the latest EAP Version of GitToolBox and also tried to downgrade to the latest stable version.

I have an aggregator pom as an intellij-module in my project and also all the modules inside the aggregator pom.

Some (the most) of the submodules now showing the current branch name of the parent module next to their name.

Any idea? Thanks for your great work!

zielu commented 3 years ago

Hi, this falls into category of known issue. Logic is very simple there: if something is a module it shows branch. For multimodule projects this is confusing. I'll take a look if it can be hidden when module is child of another module.

gmarjano1975 commented 3 years ago

Hi, I got the same problem - but even weirder. I got a parent Module and three submodules. One submodule "A" changes the branch name in the project view - the two other submodules ("B","C") don't. They always show the parent branch name.

I compared the pomfiles of "A" and "B","C" and they are the same regarding the -Tag.

Very confusing. At the moment I must disable the plugin to avoid being on the wrong branch.

zielu commented 3 years ago

@gmarjano1975 you are probably referring to git submodules. Here issue is with one single repo containing many maven modules. Git submodules are not supported yet.

Also content of pom files has nothing to do with my plugin. I don't extract anything from them.

zielu commented 3 years ago

330 looks related

timo-rohwedder commented 3 years ago

Duplicate of #330

zielu commented 3 years ago

Let's see if original issue goes away after #330. If not I'll reopen this one.

zielu commented 3 years ago

Reopening this one #330 was a different issue

jrmihalick commented 2 years ago

@zielu I have a gradle project that is using submodules. Prior to updating to version 2021.x, I used to see the branch name decoration on all of my submodules. Now it just shows on one of any of the given submodules and it actually moves around to different submodules after I pull updates from git. Is there any way to get the decoration back on all my projects? Screen Shot 2022-01-20 at 11 52 17 AM

zielu commented 2 years ago

@jrmihalick this is side effect of adding logic to only show branches on top level repo instead of all module tree nodes. I forgot that there could be git submodules too. I'll see what I can do.

jrmihalick commented 2 years ago

@zielu Thanks. If you could make it an option that we can toggle on/off, our team of 30 or so developers would really appreciate it.

zielu commented 2 years ago

Looks like I need some more details to reproduce it. Is the project structured like this ?

Are submodule repos added as maven/gradle modules to root repo ?

jrmihalick commented 2 years ago

@zielu The project is structured like so:

Structure:

container-project-dir (directory, root of git repository)
  parent-assemble (directory, subdir in git repo)
  child-project-1 (directory, subdir in git repo)
  child-project-2 (directory, subdir in git repo)
  ...
  child-project-n (directory, subdir in git repo)

In the parent-assemble project, we have a settings.gradle which uses the gradle include mechanism to add the child projects like so (see https://docs.gradle.org/current/userguide/multi_project_builds.html):

    include 'child-project-1'
    include 'child-project-2'
    ...
    include 'child-project-n'

This results in an intellij project structure like so:

  parent-assemble
  child-project-1
  child-project-2
  ...
  child-project-n

You can view an example project of ours here: https://github.com/JumpMind/openpos-framework

zielu commented 2 years ago

@jrmihalick which directory do you open as project in Idea ? openpos-assemble or openpos-framework ?

jrmihalick commented 2 years ago

@zielu The gradle idea plugin generates an ipr file into openpos-assemble, so we can open the openpos-assemble.ipr file from there. We don't point intellij at a directory per se.

We have other projects where the ipr file is generated and placed in the parent directory of the parent-assemble project and can have an arbitrary name and just organizes all the projects to be viewed together as siblings in intellij. For example, we have intellij projects where the child projects come from 3 different git repositories, but they all appear as siblings to each other in the Intellij project workspace. Intellij figures this out, and your plugin used to also correctly figure it out and show the correct repository decorations next to each and every child project.

zielu commented 2 years ago

@jrmihalick I reproduced it - fix is on the way

jrmihalick commented 2 years ago

@zielu : Great news! Thanks!

zielu commented 2 years ago

@jrmihalick EAP build x.8.6 should be out in couple of minutes - see https://github.com/zielu/GitToolBox#eap-builds how to switch to EAP channel

zielu commented 2 years ago

Done in variant.8.8

jrmihalick commented 2 years ago

@zielu I just installed the latest plugin version (212.8.8) yesterday and I can confirm that your fix works. Thank you!!