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

Provide an option to not log that no repository was found in Gradle plugin #250

Closed
Vampire opened this issue Jul 13, 2018 · 2 comments
Closed
Milestone

Comments

@Vampire
Copy link
Contributor

Vampire commented Jul 13, 2018

In my Gradle build I'd like to just identify the commit id if it is a Git checkout.
If it is an exported build, or you are in a not-yet-supported worktree, then I just use <unknown>.
But grgit always logs an error if no repository was found.
I'd like to have an option to not log that error, and take care not to cause an NPE without not applying the plugin and opening and closing it manually.

@ajoberstar
Copy link
Owner

Since master is 3.x dev, maybe this could just be a "breaking" change and move the logging down to info? Not sure how useful the message is to people.

@Vampire
Copy link
Contributor Author

Vampire commented Jul 17, 2018

Well, I guess not too useful.
If the message is displayed, then you are not in a worktree.
If you then execute code that does not take care for null you get an NPE anyway.
And if you took care or are not using the null instance, e. g. it is only used for release purpose, then you would be safe if there were no error.

It might be good to have this as warning or error by default to get notified early up in the build, but actually the one notified is probably not the build author, which most probabyl only runs from a checkout. And build runners might not consider the message and not relay it to the build author.

If the build breaks they will though.
But breaking the build just because it might break is bad imho.

So I'd suggest maybe to log a warning by default, but provide an option to not log this warning or to lower the level to debug. Or of course no option but just level lowered. :-)

@ajoberstar ajoberstar added this to the 3.0.0 milestone Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants