Page MenuHomePhabricator

When observing a repository in Git, just "fetch <url>" without worrying about the "origin" remote
ClosedPublic

Authored by epriestley on Sun, Apr 14, 7:24 PM.

Details

Summary

Depends on D20420. Ref T13277. We currently spend substantial effort trying to detect and correct the URL of the "origin" remote in Git repositories.

I believe this is unnecessary, and we can always git fetch <url> ... to get the desired result instead of git muck-with-origin + git fetch origin .... We already do this in the more recent parts of the codebase (e.g., intracluster sync) and it works correctly in every case I'm aware of.

Test Plan
  • Grepped for origin, origin .
  • Ran bin/repository update ... to fetch a mirrored repository.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Sun, Apr 14, 7:24 PM
epriestley requested review of this revision.Sun, Apr 14, 7:26 PM
amckinley accepted this revision.Wed, Apr 17, 6:56 PM
This revision is now accepted and ready to land.Wed, Apr 17, 6:56 PM
This revision was automatically updated to reflect the committed changes.

It looks like this does actually cause some issues with very old non-bare repositories. I'll follow up in T13280. I'm likely to move toward "users should convert these to bare repositories" over retaining non-bare support, since it's been at least like 4-5 years since we created non-bare repositories.