Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 386845 - git-2.eclass: ${PN}_LIVE_REPO makes git-2 use wrong storedir (egit-src/.git)
Summary: git-2.eclass: ${PN}_LIVE_REPO makes git-2 use wrong storedir (egit-src/.git)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Donnie Berkholz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 22:01 UTC by SpanKY
Modified: 2012-01-19 17:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
When constructing storedir, strip trailing '/.git' directory. (When-constructing-storedir-strip-trailing-git-dire.patch,841 bytes, patch)
2011-12-23 14:26 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2011-10-11 22:01:12 UTC
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
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-12-23 14:22:06 UTC
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?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-12-23 14:26:59 UTC
Created attachment 296745 [details, diff]
When constructing storedir, strip trailing '/.git' directory.

Fixes:
Comment 3 SpanKY gentoo-dev 2011-12-31 06:38:39 UTC
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.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-19 17:51:40 UTC
Committed.