Page MenuHomePhabricator

Add "Fetch Rules" to observed Git repositories
ClosedPublic

Authored by epriestley on Apr 14 2019, 8:14 PM.
Tags
None
Referenced Files
F13246275: D20422.id48775.diff
Thu, May 23, 9:07 AM
F13242041: D20422.diff
Thu, May 23, 1:43 AM
F13236769: D20422.diff
Tue, May 21, 10:53 AM
F13236509: D20422.diff
Tue, May 21, 9:56 AM
F13206214: D20422.diff
Wed, May 15, 6:10 AM
F13174030: D20422.id48775.diff
May 7 2024, 9:42 PM
Unknown Object (File)
May 2 2024, 2:06 PM
Unknown Object (File)
Apr 20 2024, 4:45 PM
Subscribers
None

Details

Summary

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:

refs/heads/master

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

refs/heads/*
refs/tags/*

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

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable