Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 379247 - inability to switch branch, when branch=tag|commit, with git-2 eclass
Summary: inability to switch branch, when branch=tag|commit, with git-2 eclass
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal major
Assignee: Donnie Berkholz (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-15 11:41 UTC by tokiclover
Modified: 2011-10-04 18:20 UTC (History)
1 user (show)

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


Attachments
diff of the required change to be able to switch TAG/COMMIT branch (git-2.eclass.diff,1.51 KB, patch)
2011-08-15 11:41 UTC, tokiclover
Details | Diff
diff of the required change to be able to switch TAG/COMMIT branch (git-2.eclass.diff,1.92 KB, patch)
2011-08-26 22:53 UTC, tokiclover
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tokiclover 2011-08-15 11:41:49 UTC
Created attachment 283407 [details, diff]
diff of the required change to be able to switch TAG/COMMIT branch

git-2 _src_unpack() fails to unpack because git-2_branch() fails to switch branch when it comes to: there's only a master branch (e.g. linux.git) and one has to clone the master branch and switch to a TAG or a COMMIT branch with a `git checkout -b branch-$EGIT_TAG $EGIT_TAG' (for the TAG case). EGIT_COMMIT is already implemented but I could not make use of it without a slight change to git-2_bracnh(). EGIT_TAG is not yet implemented and I have to add a few lines to be able to clone e.g. v3.0 on linux  mainline--it's much easier to use EGIT_TAG rather than a very long, no human understandable, commit string.
Comment 1 tokiclover 2011-08-26 22:53:40 UTC
Created attachment 284755 [details, diff]
diff of the required change to be able to switch TAG/COMMIT branch

Second patch already! well, this was necessary as switching branch relying only on EGIT_TAG did not work at all with the previous patch. there weren't much to do but it shall be done in order to. well, actually it worked only and only if EGIT_COMMIT is set. the issue is that EGIT_BRANCH and EGIT_COMMIT are defined to default to EGIT_MASTER... that's explain why it did not work.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-23 14:04:30 UTC
# @ECLASS-VARIABLE: EGIT_COMMIT
# @DESCRIPTION:
# Variable containing commit hash/tag we want to check out.
# It can be overriden via env using packagename_LIVE_COMMIT
# variable.

In other words, you can put tag into EGIT_COMMIT as well. Unless I'm misunderstanding you.
Comment 3 tokiclover 2011-10-04 18:20:34 UTC
You're not, simply, even if now I don't remember exactly the source of my previous nightmare, the second patch infirm that because of the default value of ${EGIT_BRANCH:=$EGIT_MASTER}. Simply put, if EGIT_COMMIT was enough, then it wouldn't fail badly to switch to a branch based only on a TAG.