Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

Scheduled maintenance on the database layer will take place on 2022-07-02. We expect GitLab.com to be unavailable for up to 2 hours starting from 06:00 UTC. Kindly follow our status page for updates and read more in our blog post.

  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !13837

Prevent git push when LFS objects are missing

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged James Edwards-Jones requested to merge jej/fs-prevent-push-when-missing-objects into master Aug 25, 2017
  • Overview 72
  • Commits 2
  • Pipelines 23
  • Changes 4

What

Finds new blobs during git-receive-pack and checks for any LFS pointers. If any of these are not in the lfs_objects table from a prior git lfs push then an error is raised to abort the push.

Why

Prevent repos getting to a broken state where they can' be cloned or have changes pulled.

Performance

  • This involves checking each new blob to see if it is an LFS pointer.
  • This uses git rev-list to find new blobs and checks
  • Fetching blob details is currently done with Rugged when we'd preferably use gitaly
  • For repositories which don't use LFS we'll want a way of bypassing this slow check

Todo

  • Do we need a way to bypass this if git lfs push --all fails to work?
  • Consider having some kind of limit on this for performance
  • Enquire about performance impact of current approach

Screenshot

pre-receive hook declined

Acceptance criteria

  • Changelog entry added, if necessary
  • Documentation created/updated
  • API support added
  • Tests added for this feature/bug

Related

  • Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24564
  • Accidentally committed to EE in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2761 which this replaces
Edited Nov 06, 2017 by James Edwards-Jones
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: jej/fs-prevent-push-when-missing-objects