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
F13105638: D20894.id49804.diff
Sat, Apr 27, 4:33 PM
Unknown Object (File)
Thu, Apr 25, 1:56 AM
Unknown Object (File)
Tue, Apr 23, 5:28 PM
Unknown Object (File)
Thu, Apr 11, 9:35 AM
Unknown Object (File)
Thu, Apr 4, 7:14 PM
Unknown Object (File)
Mar 29 2024, 4:27 AM
Unknown Object (File)
Mar 29 2024, 2:05 AM
Unknown Object (File)
Mar 28 2024, 8:49 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.