i have a lot of git repos cloned locally. rather than letting git-2.eclass maintain its own copy (which can be pretty large sometimes), i set a lot of ${PN}_LIVE_REPO variables. but switching between diff ${PN} shows weird output. this seems to be due to using /usr/portage/distfiles/egit-src/.git for all transactions ... for example: cd ~ eval $(portageq envvar -v PORTDIR) git clone git://git.overlays.gentoo.org/proj/openrc.git export openrc_LIVE_REPO=$PWD/openrc/.git git clone git://git.overlays.gentoo.org/proj/crossdev.git export crossdev_LIVE_REPO=$PWD/crossdev/.git ebuild $PORTDIR/sys-devel/crossdev/crossdev-99999999.ebuild clean setup unpack ebuild $PORTDIR/sys-apps/openrc/openrc-9999.ebuild clean setup unpack that crazy diffstat that shoots by makes me think that i've set ${PN}_LIVE_REPO to the wrong path
Ok, I see where the problem is. git-2_init_variables() updates EGIT_REPO_URI while git-2_prepare_storedir() would rather prefer seeing the original one. Although the best solution seems to mix the two functions a little, that wouldn't cover all the cases (especially when EGIT_REPO_URI is unset in the ebuild). As for the first step, I'd suggest you not to add '.git' to URIs. git should be able to do a neat clone from workdir as well. I'll also add stripping of trailing '.git' from EGIT_REPO_URI when constructing EGIT_DIR. The remaining question is: should git-2 always construct the storedir from current repo URI or the original one? What if there is no original URI?
Created attachment 296745 [details, diff] When constructing storedir, strip trailing '/.git' directory. Fixes:
if i have ${PN}_LIVE_REPO set, i don't expect git-2.eclass to hit the network at all. further, i don't even really like git creating a full copy on disk. it should be re-using the git objects that live in my ${PN}_LIVE_REPO.
Committed.