Page MenuHomePhabricator

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

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



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

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

Event Timeline

epriestley created this revision.Apr 14 2019, 7:24 PM
epriestley requested review of this revision.Apr 14 2019, 7:26 PM
amckinley accepted this revision.Apr 17 2019, 6:56 PM
This revision is now accepted and ready to land.Apr 17 2019, 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.