Open alifeee opened 7 months ago
Hi @alifeee thanks for the suggestion. Do you know if it's possible to detect a shallow clone from within the repo so we could display a warning in those cases when the git dates are used?
I like the first sentence of your note, but I'm a little torn on the second because of the way it's written. I will think about it if I find a better fitting version - otherwise I will merge this this weekend.
it looks like a shallow repository can be detected by (source):
git rev-parse --is-shallow-repository
Would this be better as a warning or an error? If it was a warning then it would not be that visible on a CI system? I'm not the most knowledgeable about what happens to emitted warnings.
Perhaps it would appear under people's workflows?
Anyway if this were the case then we might not need a warning in the docs here. What do you think?
Add note
to
git Last Modified
andgit Created
on the Content Dates pageMost CIs checkout a shallow copy of the repository, in which case the
git Created
andgit Last Modified
dates will be wrong. This reminds people to disable shallow-cloning if using these two date types.For example, in GitHub actions you must run
for
git Created
andgit Last Modified
to work with Eleventy on the runners