import just “reads and evalutes” a file or directory. That being said, i think the main question is just “Any difference in using overlay vs importing?”
An overlay is kind of like mount points, they will “overwrite” the packages that were there before, where as just importing allows you to reference the package directly. Where this matters most is if your pinned package is a dependency of other packages, then an overlay will substitute all references to package with the pinned package. Where as an import will not.
An example would be if you pinned gcc with an overlay, then pretty much all packages will be rebuilt with the pinned gcc package. Where as just importing a different gcc version will allow you reference it, but it won’t be used to create other packages.
Thank you for the nice and clear answer, learned something today
Also, the main reason why I wanted to know was, that I had a problem:
Whatever version I selected via niv add/update/modify, the version of the installed package just remained the same.
Today I found that I was using the version option of niv instead of the branch option, and that the version was just a meaningless meta data in this case.
Took me half a day
So, to everyone out there, if the dependency versions of niv managed deps that are pulled of Git(hub) look suspicious, don’t be mislead by the version field but instead use the -bniv option and pass the git-branch/tag/commit-id of the version you intend to depend on.