Page MenuHomePhabricator

Parse "shallow" frames in the Git "upload-pack" wire protocol parser
ClosedPublic

Authored by epriestley on Jun 13 2019, 11:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 10:10 PM
Unknown Object (File)
Mon, Dec 16, 10:02 AM
Unknown Object (File)
Fri, Dec 13, 6:13 PM
Unknown Object (File)
Fri, Dec 13, 5:28 PM
Unknown Object (File)
Fri, Dec 13, 4:54 AM
Unknown Object (File)
Wed, Dec 11, 6:59 AM
Unknown Object (File)
Wed, Dec 11, 6:59 AM
Unknown Object (File)
Wed, Dec 11, 6:59 AM
Subscribers
None

Details

Summary

Fixes T13309. If you void the warranty on a repository on disk and turn it into a shallow clone, Phabricator currently can't serve it.

We don't support hosting shallow working copies, but we should still parse and proxy the protocol rather than breaking in a mysterious way.

Test Plan
  • Created a shallow working copy with mv X X.full; git clone --depth Y file://.../X.full X in the storage directory on disk.
  • Cloned it with git clone <uri>.
  • Deleted all the refs inside it so the wire only has "shallow" frames; cloned it.

Diff Detail

Repository
rP Phabricator
Branch
shallow1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22977
Build 31535: Run Core Tests
Build 31534: arc lint + arc unit

Unit TestsFailed

TimeTest
1 msMetaMTAEmailTransactionCommandTestCase::testGetAllTypes
EXCEPTION (Exception): msort() was passed a method ("getRevisionActionOrderVector") which returns "PhutilSortVector" objects. Use "msortv()", not "msort()", to sort a list which produces vectors. #0 /core/data/drydock/workingcopy-82/repo/phabricator/src/applications/differential/command/DifferentialActionEmailCommand.php(59): msort(Array, 'getRevisionActi...') #1 [internal function]: DifferentialActionEmailCommand->getCommandObjects()
1 msAlmanacNamesTestCase::testServiceOrDeviceNames
30 assertions passed.
0 msAlmanacServiceTypeTestCase::testGetAllServiceTypes
1 assertion passed.
0 msAphrontHTTPSinkTestCase::testHTTPHeaderNames
2 assertions passed.
0 msAphrontHTTPSinkTestCase::testHTTPSinkBasics
3 assertions passed.
View Full Test Results (1 Failed · 368 Passed)

Event Timeline

In the Discourse thread (https://discourse.phabricator-community.org/t/how-to-have-a-shallow-git-mirror/2805/) the reporting user also reported that this patch worked in their (illegal, forbidden) use case.

Is it expected that B22956 never completed?

Oh, not sure what happened there -- that's the local result, so maybe I ^C'd too fast. Let me just kick it...

  • Plus a rebase for the msortv() change.
This revision is now accepted and ready to land.Jun 18 2019, 9:08 PM