Page MenuHomePhabricator

Always initialize Git repositories with "git init", never with "git clone"
ClosedPublic

Authored by epriestley on Nov 8 2019, 12:07 AM.
Tags
None
Referenced Files
F15524203: D20894.diff
Mon, Apr 21, 6:35 AM
F15505420: D20894.diff
Tue, Apr 15, 2:59 AM
F15465337: D20894.id.diff
Wed, Apr 2, 5:33 PM
F15461118: D20894.diff
Tue, Apr 1, 5:24 AM
F15426513: D20894.diff
Mar 23 2025, 9:17 AM
F15424324: D20894.id49801.diff
Mar 22 2025, 9:31 PM
F15411293: D20894.diff
Mar 19 2025, 8:58 AM
F15411240: D20894.diff
Mar 19 2025, 8:56 AM
Subscribers
None

Details

Summary

Fixes T13448. We currently "git clone" to initialize repositories, but this will fetch too many refs if "Fetch Refs" is configured.

In modern Phabricator, there's no apparent reason to "git clone"; we can just "git init" instead. This workflow naturally falls through to an update, where we'll do a "git fetch" and pull in exactly the refs we want.

Test Plan
  • Configured an observed repository with "Fetch Refs".
  • Destroyed the working copy.
  • Ran "bin/repository pull X --trace --verbose".
    • Before: saw "git clone" pull in the world.
    • After: saw "git init" create a bare empty working copy, then "git fetch" fill it surgically.

Both flows end up in the same place, this one is just simpler and does less work.

Diff Detail

Repository
rP Phabricator
Branch
refs3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23630
Build 32484: Run Core Tests
Build 32483: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Nov 8 2019, 12:17 AM
This revision was automatically updated to reflect the committed changes.