Hacker News new | ask | show | jobs
by jacobegold 998 days ago
GitHub actually stores all the data necessary to do this without changing your ref model as the article suggests — even if you force push, it never garbage collects the commits that the branch used to point to.

I work on a tool that includes a UI for diffing versions of a GitHub PR, but you can totally get the same thing via messing with GitHub.com URLs.

2 comments

Hi! I work with the commenter - for those wondering here's documentation on that feature (pulled off with pretty much only GH data):

https://graphite.dev/docs/pull-request-versions

If people are interested, probably a thing we could do a technical blog post on.

I agree, we work on Reviewable, which uses those same blobs.

However, we add tags to commits we're referencing, just in case someone at GitHub gets around to implementing garbage collection!

They must have refs on the internal git servers -- they need them for the "force pushed from X to Y" timeline events
I've definitely clicked those links through to 404s.
You're right, though I think that changed recently? I vaguely remember only the last force push showed up, but now I see more than one so :shrug: