Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 299434 - Git eclass feature requests
Summary: Git eclass feature requests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Tomáš Chvátal (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-03 03:53 UTC by Francis Galiegue
Modified: 2011-04-20 21:56 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Galiegue 2010-01-03 03:53:27 UTC
I compile quite a lot of packages from the gentoo x11 overlay and it uses the git eclass. However, it can do a better job of it...

1. One thing is that it keeps the sources in /usr/portage/distfiles/git-src/xxxx and git pulls in this directory - good.

2. However, this is not a bare repository - medium...

3. The other thing is that it clones this repository into /var/tmp/portage for compiling - bad!


For 1. and 2., the initial repository creation could go like this:

mkdir /usr/portage/distfiles/git-src/xxx
cd /usr/portage/distfiles/git-src/xxx
git init --bare
git remote add -f <theremoteurlhere> #Note: -f means fetch, not force

Then on subsequent emerges, if the repository is here, cd into the directory and git fetch.

For 3.: there's no need to clone: just cd into the repository and use git archive, ie:

git archive --prefix=packagename/ master | tar xf -C /var/tmp/portage/xxxx

Finally, a VERY nice feature to have would be to be able to tag the currently emerged version and keep this information somewhere: people who choose git-based repositories like to play with fire, but being able to revert to a previous known good git version is possible (unlike with CVS and SVN).

Why not a series of commands like:

qgittag <packagename> <tagname> #would error on non git ebuilds, of course...
# then, later
GITTAG=<tagname> emerge <packagename>

This would influence, of course, the git archive command above. And it would be a great help for developers, since this means you have a local git repository fit for cloning _and_ bisecting.


Reproducible: Always

Steps to Reproduce:
Irrelevant
Comment 1 Tomáš Chvátal (RETIRED) gentoo-dev 2011-04-20 21:56:51 UTC
(In reply to comment #0)
> I compile quite a lot of packages from the gentoo x11 overlay and it uses the
> git eclass. However, it can do a better job of it...
> 
> 1. One thing is that it keeps the sources in
> /usr/portage/distfiles/git-src/xxxx and git pulls in this directory - good.
> 
> 2. However, this is not a bare repository - medium...

bare / non bare is figured based on use of submodules or specified variable that switchs between them

feel free to figure out how to manage the submodules in bare repository without checking them out everytime anew and it can be dependant only by that option.

> 
> 3. The other thing is that it clones this repository into /var/tmp/portage for
> compiling - bad!
It must do all the operations in /var/
Plus quite few packages expect the .git folder to be around, thats why it is not done using copy or archive option.

> 
> Finally, a VERY nice feature to have would be to be able to tag the currently
> emerged version and keep this information somewhere: people who choose
> git-based repositories like to play with fire, but being able to revert to a
> previous known good git version is possible (unlike with CVS and SVN).
> 
> Why not a series of commands like:
> 
> qgittag <packagename> <tagname> #would error on non git ebuilds, of course...
> # then, later
> GITTAG=<tagname> emerge <packagename>
> 
> This would influence, of course, the git archive command above. And it would be
> a great help for developers, since this means you have a local git repository
> fit for cloning _and_ bisecting.
> 
> 
This is already possible for user:
EGIT_COMMIT="hash" emerge -1v myliveebuild
or:
EGIT_BRANCH="mybranch" emerge -1v myliveebuild

Oh also there is new git-2 eclass which is much more readable so migrate your ebuids to it.

And also it took me just bit over a year to reply and close this bug, damn i need more time :)