Page MenuHomePhabricator

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

Authored by bluehawk on Aug 12 2014, 9:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:29 PM
Unknown Object (File)
Wed, Apr 17, 5:28 AM
Unknown Object (File)
Tue, Apr 16, 8:10 AM
Unknown Object (File)
Thu, Apr 11, 6:56 AM
Unknown Object (File)
Fri, Apr 5, 9:29 PM
Unknown Object (File)
Thu, Mar 28, 10:52 AM
Unknown Object (File)
Mar 13 2024, 5:14 AM
Unknown Object (File)
Feb 25 2024, 8:23 AM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Summary

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

Repository
rP Phabricator
Branch
ghostbusters
Lint
Lint Skipped
Unit
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