ezyang / ghstack

Submit stacked diffs to GitHub on the command line
MIT License
657 stars 55 forks source link

Saving all historical revisions of each change #254

Closed yang closed 4 months ago

yang commented 4 months ago

Would you be open to a PR that adds a config option that makes ghstack save each revision of a commit/PR to a gh/yang/1/REV, where REV is just an increasing num?

Why: GitHub will GC commits, causing the comments and reviews around them to be lost in the PR UI when amending commits.

How this helps: This essentially snapshots/archives all to an immutable persistent branch that lives forever. (Inspired by Gerrit.)

ezyang commented 4 months ago

Some thoughts here:

  1. ghstack actually will never lose trees. Specifically, every tree in the history is reflected in the history of the HEAD branch in the GitHub PR. So really what you're preserving is some extra commit metadata on top of the trees
  2. I've noticed that git pull gets materially slower if you have tons of refs; this is probably not a big deal for a sleepy repository but on PyTorch it's very noticeable lol

So... I guess we can do this? But I wonder if your opinion about it is different given this information.

yang commented 4 months ago

It certainly is, thanks for the pointer - will take a closer look at that!