Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow to provide non-default path to project .git folder #284

Closed
Tapchicoma opened this issue Sep 28, 2019 · 3 comments · Fixed by #323
Closed

Allow to provide non-default path to project .git folder #284

Tapchicoma opened this issue Sep 28, 2019 · 3 comments · Fixed by #323
Assignees

Comments

@Tapchicoma
Copy link
Collaborator

Followup of #101:
Current implementation only adds a git hook, when .git/ folder is located in Gradle root project folder. But quite often project has non-gradle top folder. Plugin should add a way to define non-standard ./git folder location.

@tasomaniac
Copy link
Contributor

I just tried this and hit the same problem. 2 points to add:

  • Even if I moved the pre_commit hook into the correct .git/ folder, the relative paths of the changed files also need to be adjusted according to the root folder of the project. Right not it cannot find the file locations.

  • Secondly, grgit is a really good library to deal with Git operations in Gradle. It can find the closest git to the current path (that's also how regular command line git works). So without the custom property in the plugin, we can detect the correct .git folder.

@tasomaniac
Copy link
Contributor

Hi, I tried in our project but addKtlintFormatGitPreCommitHook task is not even created.

@tasomaniac
Copy link
Contributor

Ok, it looks like I needed to apply it also to the root project. All good.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants