I would like to add a subdirectory of another repo into mine preserving history and maintaining a way to pull updates whenever they are added to upstream.
Firstly, I considered using Git submodules; the problem is that submodules are full-fledged nested repos and there is no way to filter them.
A similar solution I found are the Git subtrees: they seem to integrate better into root repo history, but as far as I can tell they don't offer a filtering solution either.
Also Git subrepo seems to have similar features and limitations of the above solutions.
The only solution I found is to use Git filter-repo to filter the upstream repository history, then use this filtered repo as my upstream with Git subtree or another of the above tools. The problem with this solution is that tracking updates from the "true" upstream becomes a pain.
Is there a better solution?