Page MenuHomePhabricator

Adding repository/prune command to remove orphaned commits from phabricator
Needs RevisionPublic

Authored by bluehawk on Aug 12 2014, 9:41 PM.
Referenced Files
F10895142: D10246.diff
Mon, Jul 4, 2:30 PM
Unknown Object (File)
Thu, Jun 23, 10:41 PM
Unknown Object (File)
Mon, Jun 13, 4:00 PM
Unknown Object (File)
Mon, Jun 13, 3:01 AM
Unknown Object (File)
Apr 16 2017, 4:53 AM
Unknown Object (File)
Apr 6 2017, 9:18 PM
Unknown Object (File)
Mar 14 2017, 10:13 AM
Unknown Object (File)
Mar 7 2017, 10:07 AM


Group Reviewers
Blessed Reviewers

Loops over all commits and tries to resolve them in VCS, then asks to delete any that aren't reachable.

Only works in git for now.

Test Plan

Orphan some commits (delete a branch, or force rewind a branch), then run prune.

Diff Detail

rP Phabricator
Lint Skipped
Tests Skipped
Build Status
Buildable 2187
Build 2191: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

bluehawk retitled this revision from to Adding repository/prune command to remove orphaned commits from phabricator.
bluehawk updated this object.
bluehawk edited the test plan for this revision. (Show Details)
bluehawk added a reviewer: epriestley.

Showing 173 orphaned commits, pruning them, then showing 0. The commits are now gone from git, but not from phabricator.

undefined (200×639 px, 26 KB)

Phabricator doesn't handle the case of commits disappearing very well. Most of the commit data is still there, but when it tries to fetch the parents of the commit it explodes:

undefined (907×1 px, 130 KB)

Running prune:

undefined (185×968 px, 31 KB)

undefined (153×548 px, 15 KB)

After running that, viewing commits results in a 404 as expected.

Couple notes:

  • I'm just running PhabricatorRepsitoryCommit->delete(), which seems to work fine, but it might leave somethings behind.
  • Only works on git, as that's the only one I'm familiar with and have easily available to test.

This is obsoleted by the introduction of commit "reachability", bin/repository mark-reachable, and other related changes.

This revision now requires changes to proceed.Jan 11 2017, 3:34 PM