Page MenuHomePhabricator

Add "Fetch Rules" to observed Git repositories

Authored by epriestley on Apr 14 2019, 8:14 PM.



Depends on D20421. Ref T13277. I'd generally like to move away from "Track Only".

Some of the use cases for "Track Only" (or adjacent to "Track Only") are better resolved with "Fetch Rules" -- basically, rules to fetch only some subset of refs from the observed remote.

Add configurable "Fetch Rules" for Git repositories. For example, if you only want to fetch master, you can now speify:


If you only want to fetch branches and tags, you can use:


In theory, this is slightly less powerful in the general case than "Track Only", but gives us better behavior in some cases (e.g., when the remote has 50K random temporary branches). In practice, I think this and a better "Autoclose Only" will let us move away from "Track Only", get default behavior which is better aligned with what users actually expect, and dodge all the "track tags/refs" questions.

Test Plan

Configured repositories with "Fetch Refs" rules, used bin/repository pull --verbose --trace ... to run pulls, saw expected pull/fetch behavior.

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, 8:14 PM
epriestley requested review of this revision.Apr 14 2019, 8:15 PM
amckinley accepted this revision.Apr 17 2019, 7:13 PM
This revision is now accepted and ready to land.Apr 17 2019, 7:13 PM
This revision was automatically updated to reflect the committed changes.