ajoberstar / gradle-git

Git plugin for Gradle
Apache License 2.0
561 stars 89 forks source link

Don't silently swallow an exception #257

Closed augi closed 7 years ago

augi commented 7 years ago

If we apply the plugin on project and the Git repo is not found there or is corrupted, then it's IMHO critical failure.

ajoberstar commented 7 years ago

The old behavior is needed if someone downloads the source of a project as a zip rather than cloning the repo. They shouldn't get a failure because the Git repo isn't found.

augi commented 7 years ago

So they get a failure few lines later because grgit property is not available - it's IMHO more clear to inform about the failure as soon as possible, isn't it?

ajoberstar commented 7 years ago

There's already a warning log, so it's not like it's hidden. The ideal behavior is that any logic depending grgit is only applied if the Git repo is found. If not, it should either do nothing or provide some fallback behavior.

ajoberstar commented 7 years ago

So, there may need to be something in this plugin that could help grgit users guard their logic against the repo being missing. But ultimately other plugins or builds that use grgit would be responsible for making sure they don't blow up if a Git repo isn't present.