Isn't it normal to copy code with citations into your project? It also helps document what's going on.
And if an architecture decision is so significant, retain a repository of architecture decision records.
// Credit Foo Project per MIT license
// See <https://github.com./foo/project/path/to/file
fn some_foo_fn() {
This has nothing to do with git history.