I went to use git.eclass with GIT_BRANCH in my local overlay and noticed the following: * git update start --> * repository: git://repo.or.cz/ule.git fatal: ambiguous argument 'unstable': unknown revision or path not in the working tree. Use '--' to separate paths from revisions remote: Generating pack... remote: Done counting 7 objects. remote: Result has 5 objects. remote: Deltifying 5 objects... remote: /5) done/5) done remote: Total 5 (delta 3), reused 0 (delta 0) Unpacking 5 objects... 100% (5/5) done * refs/heads/unstable: storing branch 'unstable' of git://repo.or.cz/ule commit: e8913d1 * local clone: /mnt/linear/Paludis/distfiles/git-src/update-live-ebuilds-live * committish: master 'Unstable' wasn't available until after the fetch so maybe this is a good time to change to the branch? Thanks
Define 'doesn't work'. It looks to me like what doesn't work is showing the diffstat between last state and new state, and since there is no 'previous state' if the branch is not present, I don't see what the problem is. Also, please paste what EGIT_* variables you had before 'inherit git'. - ferdy
Created attachment 130901 [details] Reproduces a problem
OK, first of all, I was making a false assumption that commitish would show the branch that we were changing to, but now that I'm trying this ebuild it's not even changing to the branch at all afaict. I have attached my ebuild above, it is supposed to download and install the 'unstable' branch from the update-live-ebuilds repo. Here's the gitweb for that repo: http://repo.or.cz/w/ule.git It's installing commit 9d7b8f7e163ae8f83064a17c07aaa22aa1ba13dc (master) when I would have expected it to install e8913d1f4bdcf6684891de43bf30cdd14d2b842b from the unstable branch. In comment #1 I was trying to show how the fatal warning that said it couldn't switch to unstable, and was suggesting that maybe the eclass switches too early, maybe more prudent to wait until after the fetch occurs.
You have to declare EGIT_* variables BEFORE doing 'inherit git'. Just for the record, git.eclass does not CHANGE branches it just extracts whatever it needs. That being said, I reckon that the 'fatal' error should be sent to /dev/null and avoid doing the diffstat if we didn't get a proper committish. Please try defining those vars before inheriting git.eclass and tell me whether it works (it should). - ferdy
Yes, that works, thanks
Either set EGIT_BRANCH before the inherit, or set both EGIT_BRANCH and EGIT_TREE after the inherit. I added a comment to this effect in the eclass.