Git development
 help / color / mirror / Atom feed
* Detecting pushes originating from shallow clones?
@ 2015-11-30 22:27 Owen Jacobson
  2015-11-30 22:52 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Owen Jacobson @ 2015-11-30 22:27 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

Hi folks,

Here at Heroku, we ingest code from users by supplying them with a Git server they can `git push` into. Occasionally, users will attempt to push to us from a shallow clone, which causes numerous problems for us and, often, for our users (incomplete repositories, gaps in history, failed builds, and a host of other problems). We’ve been investigating what we can do to give these users clearer advice on how to fix the problem.

Within the constraints that

* we cannot control which version of Git our users have installed, and
* we run Git v1.9.1, obtained from the Ubuntu 14.04 LTS .deb repositories

what can we do in an update/pre-receive hook to detect that an incoming push originates from a shallow repository and reject it?

Right now, the best strategy we have is to observe whether

    git rev-list OLD NEW

fails, and if it does fail, whether the stderr output includes the phrase "revision walk setup failed”. This feels like a fairly weak fix, so I thought I’d see if anyone here has a better idea.

Thanks,

-o


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-30 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30 22:27 Detecting pushes originating from shallow clones? Owen Jacobson
2015-11-30 22:52 ` Junio C Hamano
2015-11-30 23:11   ` Owen Jacobson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox