rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
11k stars 547 forks source link

Damaged History #253

Open cowboygneox opened 6 years ago

cowboygneox commented 6 years ago

I used BFG to remove a number of large files from a repository composed of many individual repositories (built a monorepo using subtree). After running it, it appears the git log --full-history doesn't go back past the subtree merge, which it used to prior to running BFG. Considering the nature of this tool, it doesn't surprise me, but does anyone have any thoughts for how I can fix it/go around it?

javabrett commented 6 years ago

I would expect subtree merges to introduce significant complexity, so I am unsurprised that you are having trouble.

Since your case will be quite specific, your best bet of getting comments on what BFG might be doing with your repos would be to create trivial public repo(s) which match what you are trying to do then show a before/after BFG and what your expectations are. But it does sound like it could turn into a consulting exercise pretty quickly :).

cowboygneox commented 6 years ago

I was thinking the same thing: that I make a simple repository that is similar to our layout that I can host on GitHub for others to see. I'll try to do that within the next couple weeks (as it is not the highest priority at the moment).

Side note: has anyone thought about using BFG to flatten subtrees so that the repository looks like it was always a single repository? Or does BFG's non-serial approach prohibit the addition of such a function?

javabrett commented 6 years ago

BFG is optimised to clean trees, and it does-so very efficiently. In doing-so it doesn't keep track of much information about the trees e.g. path/depth etc. So no, it would be non-trivial to create a BFG feature that attempts to merge trees from different repositories, since it doesn't really currently work like that.