Hypothetical situation: Our organization developed closed-source commercial software that used open-source libraries whose terms only apply on redistribution. At some point, we decide to open-source our software but under a license that is incompatible with the aforementioned libraries. We rewrite those parts of our software so the latest revision no longer relies on any open-source libraries.
What happens when we publish our source-code repository?
If our source-code history contains revisions where our software relied on the open-source libraries, does their licensing terms kick in? Or is the latest revision of the source-code repository the only thing relevant from a legal perspective?
If the entire history is relevant, would truncating the source-code history (removing references to the open-source libraries) be sufficient to protect us?
What about intellectual property? If past revisions infringed on someone's IP but the latest revision does not, are we still at risk? Would truncating history protect us?
Broadly speaking, do past software revisions place us at legal risk from a copyright and/or IP perspective even if the latest revision does not infringe?