timvink / mkdocs-git-revision-date-localized-plugin

MkDocs plugin to add a last updated date to your site pages
https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/index.html
MIT License
206 stars 44 forks source link

Multiple/wrong warnings printed in CI #75

Closed oliversalzburg closed 2 years ago

oliversalzburg commented 2 years ago

When I built my site in our GitLabi CI setup, I got the following output multiple times:

WARNING:root:
                [git-revision-date-localized-plugin] Running on a GitLab runner might lead to wrong
                Git revision dates due to a shallow git fetch depth.
                Make sure to set GIT_DEPTH to 1000 in your .gitlab-ci.yml file
                (see https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone).

WARNING:root:
                [git-revision-date-localized-plugin] Running on bitbucket pipelines might lead to wrong
                Git revision dates due to a shallow git fetch depth.
                Try setting "clone: depth" to "full" in your pipeline
                (see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
                and search 'depth').

I understand the reason for this and have already made my adjustments. But the note regarding BitBucket is wrong, as I'm not on BitBucket. Maybe the different cases could be separated by switch-case or elseif statements to show only a single one.

Also, the README of this project says to use GIT_DEPTH = 0. The warning says GIT_DEPTH = 1000. This can be confusing to new users. IMHO GIT_DEPTH = 0 is the safe default.

timvink commented 2 years ago

Thanks for letting me know !

Would you like to provide a PR yourself?

If not, I'd be happy to pick it up next time I work on some open source projects.

oliversalzburg commented 2 years ago

Sadly, I have very little Python experience and am still trying to find my way around all the tooling and get a development environment set up. If this goes anywhere soon, I might also try to work on this.