Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Fail on shallow Git clones #68

Open
fbiville opened this issue Dec 31, 2019 · 1 comment
Open

Fail on shallow Git clones #68

fbiville opened this issue Dec 31, 2019 · 1 comment
Milestone

Comments

@fbiville
Copy link
Owner

When one clones a repository with a limited depth (such as the most extreme git clone [...] --depth=1), every file will be associated with the oldest fetched commit in the shallow clone or newer.
In other words, files that pre-dates the earliest shallow clone's commit will be considered as created at that commit, which is wrong. In the above extreme example, all files are considered created at the shallow clone sole commit.

The only safe way seems to reject shallow clones entirely.
Luckily, the shallowness information is accessible since Git 2.15, as explained here.

@fbiville fbiville added this to the 1.0.0-M05 milestone Dec 31, 2019
@glyn
Copy link

glyn commented Jan 6, 2020

I agree that rejecting shallow clones seems like the best approach. Not sure what's best if git has version less than 2.15 - should that fail as well to be on the safe side?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants