Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submodule support #1

Open
koraktor opened this issue May 12, 2011 · 11 comments
Open

Submodule support #1

koraktor opened this issue May 12, 2011 · 11 comments
Assignees
Labels

Comments

@koraktor
Copy link
Owner

Mavanagaiata works great with submodules through customized plugin executions using different settings for gitDir and other properties.

But it would be great, if there was a way to let this happen automagically, creating properties (and files) based on submodules.

@ghost ghost assigned koraktor May 12, 2011
@ravn
Copy link

ravn commented Jan 26, 2012

For our purpose it would be fine if was not expected by default to be in the parent folder of basedir, but located by looking in the parent folder of basedir, and if not found the parent of the parent, etc. all the way to the top.

@koraktor
Copy link
Owner Author

If I understand you, you're not having Git submodules, but one Git repository for several Maven projects, right?

@ravn
Copy link

ravn commented Jan 30, 2012

Yes. I am still new to the Maven mindset and apparently misunderstood what you were describing. Can the current version do what I describe?

@koraktor
Copy link
Owner Author

It won't work out of the box. I guess that this would work, but may require a somewhat complex configuration. You will at least need to specify the gitDir to use .git/ of the parent directory.

@ravn
Copy link

ravn commented Feb 11, 2012

That is what I did, but I don't quite understand why it would not be possible to ask to search up towards the root. Ant can do it when looking for build.xml.

@koraktor
Copy link
Owner Author

I didn't say that this isn't entirely impossible, but it won't work with the current version of Mavanagaiata out-of-the-box.

I just opened a new issue (#8) for this use case.

@ravn
Copy link

ravn commented Dec 18, 2012

I have now tried moving the mavanagaiata configuration snippet into a parent pom (sitting a directory level above each module which need this) and the parent pom.xml is next to .git/ and the automatic search does not work with 0.4.1.

What is the proper way to do this for automatic searching of .git to work?

@koraktor
Copy link
Owner Author

A parent POM won't help, because the baseDirs of the sub-projects stay the same (one level below .git).

Please try to setup the configuration as follows. You can choose to set either baseDir to the root of your repository or gitDir to .git (or both).

<plugin>
    <groupId>com.github.koraktor</groupId>
    <artifactId>mavanagaiata</artifactId>
    <version>0.4.1</version>
    <configuration>
        <baseDir>${project.basedir}/..</baseDir>
        <gitDir>${project.basedir}/../.git</gitDir>
    </configuration>
</plugin>

@koraktor
Copy link
Owner Author

@ravn There was a regression in 0.4.0 which was fixed in 4b4e25a which might also affect your use case.

@ravn
Copy link

ravn commented May 7, 2013

I am now experimenting with submodules (we essentially want a single super pom pulling in all our branches) and interestingly enough hit this exact open issue. In my case the explicitly pointed out ".git" folder has now become a .git-file containing "gitdir: ../.git/modules/DVER" which mavanagaiata dislikes causing our builds to break. Is this anyone else seeing this issue?

@koraktor
Copy link
Owner Author

koraktor commented May 7, 2013

This is Git's new format for submodules, the actual .git folder of the submodule will reside in .git/modules/submodule of the parent repository.

@koraktor koraktor added this to the 0.8.0 milestone Feb 13, 2014
@koraktor koraktor removed this from the 0.8.0 milestone Dec 12, 2016
koraktor added a commit that referenced this issue Feb 5, 2019
Until now, the working tree was forced to be the parent of a found
GIT_DIR. This is true for plain repositories, but fails for worktrees
and submodules. The GIT_DIR for those special repositories resides
inside the main now.

This is not supported by JGit out-of-the-box as of now. So we try to
find the `commondir` of a worktree and set it as the repository‘s
GIT_DIR.

See https://git-scm.com/docs/gitrepository-layout for further
information.

See #1
Closes #98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants