-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Detect shallow clones for git plugin to avoid reading a wrong date range (which first year being wrong) #252
Comments
I took a quick look at this yesterday, it seems JGit does expose some information that may allow detecting shallow clones without having to shell out to One problem is that if people are using the plugin in their CI environments then they're almost always going to do a shallow clone. Therefore the plugin will pretty much always fail CI if they are trying to use the new Copyright Existence Years feature (#240) in conjunction with CI. It may warrant documenting this as an explicit limitation as well as applying any code fixes |
I use this in CI all the time, it does require some special handling, mainly just checking out the branch that is being run when this is needed to run. I know recently some documentation was added due to the release plugin being changed to shallow cloning that simply cannot be gotten around. But this certainly can work on a shallow clone by checkout out the associated branch along with a fetch to know about the branches beforehand. So its really shallow plus a bit of foo processing but not deep. The reason I do this specificially is that I have it automated in case a developer forgets to run the plugin before committing ;) So it can be done and I agree special needs would need documented as such. |
Huh, I looked and didn't see this, so I did the shell version in #253. Could you point me to where that was, @rvesse ? Also, an alternative option to detecting shallow --> fail/skip, is explicitly executing |
@dbwiddis In the constructor of But like I said I've no idea if that actually works reliably as a way to detect shallow clones |
Wow, I had seen that line but ignored it as a "workaround". In fact that |
Related: The contents of So if iterating from And if we iterate from the oldest commit (which we do for creation author/email and year of creation) we wouldn't ever see it anyway. |
Typo in issue title shadow vs shallow? |
git rev-parse --is-shallow-repository
which will print false (not shallow) or true (shallow):See #240 for a use case and problem.
The text was updated successfully, but these errors were encountered: