Page MenuHomePhabricator

Allow repo updates to recover after force push + garbage collection
ClosedPublic

Authored by epriestley on Aug 11 2014, 11:08 PM.
Tags
None
Referenced Files
F13262906: D10226.diff
Mon, May 27, 4:53 AM
F13257733: D10226.id.diff
Sun, May 26, 4:35 AM
F13253499: D10226.diff
Sat, May 25, 2:43 AM
F13232100: D10226.diff
Tue, May 21, 1:01 AM
F13224127: D10226.id24634.diff
Sun, May 19, 6:33 AM
F13210966: D10226.diff
Fri, May 17, 5:22 AM
F13194851: D10226.diff
Sun, May 12, 9:55 PM
F13177589: D10226.diff
Wed, May 8, 7:49 PM
Subscribers

Details

Summary

Fixes T5839. If a repository has been force pushed and garbage collected, we might have a ref cursor in the database which still points at the old commit (which no longer exists).

We'll then run a command like git log <new hash> --not <old hash> to figure out which commits are newly pushed, and this will bomb out because <old hash> is invalid.

Instead, validate all the <old hash> values before we try to make use of them.

Test Plan
  • Forced a repository into a bad state by mucking with the datbase, generating a reproducible failure similar to the one in T5839.
  • Applied patch.
  • bin/repository update <callsign> --trace filtered the bad commit and put the repository into the right state.
  • Saw new commits recognized correctly.
  • Ran bin/repository update <callsign> for a Mercurial and SVN repo as a sanity check.

Diff Detail

Repository
rP Phabricator
Branch
forcepush
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2159
Build 2163: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Allow repo updates to recover after force push + garbage collection.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2014, 7:05 PM
epriestley updated this revision to Diff 24634.

Closed by commit rPec9eaabfbdac (authored by @epriestley).