Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612852 - git-r3.eclass: EGIT_COMMIT without EGIT_BRANCH does not work for commits on non-master branch with default clone type
Summary: git-r3.eclass: EGIT_COMMIT without EGIT_BRANCH does not work for commits on n...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-16 20:55 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2017-03-18 09:17 UTC (History)
0 users

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 Arfrever Frehtes Taifersar Arahesis 2017-03-16 20:55:43 UTC
When using default clone type, EGIT_COMMIT without EGIT_BRANCH does not work for commits on any branch other than "master".


Documentation of git-r3.eclass claims:
"""
# @ECLASS-VARIABLE: EGIT_BRANCH
# @DEFAULT_UNSET
# @DESCRIPTION:
# The branch name to check out. If unset, the upstream default (HEAD)
# will be used.
...
# @ECLASS-VARIABLE: EGIT_COMMIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# The tag name or commit identifier to check out. If unset, newest
# commit from the branch will be used. If set, EGIT_BRANCH will
# be ignored.
"""


My example ebuild (which should use branch "2.7") has:
inherit git-r3
EGIT_REPO_URI="https://github.com/python/cpython"
EGIT_COMMIT="309fb90f6895c47e7b41df3d739db45e8ec136c9"


Output:
>>> Unpacking source...
Initialized empty Git repository in /var/cache/distfiles/git3-src/python_cpython.git/
 * Fetching https://github.com/python/cpython ...
git fetch https://github.com/python/cpython +HEAD:refs/git-r3/HEAD
remote: Counting objects: 614812, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 614812 (delta 5), reused 2 (delta 2), pack-reused 614797
Receiving objects: 100% (614812/614812), 177.08 MiB | 2.14 MiB/s, done.
Resolving deltas: 100% (498304/498304), done.
From https://github.com/python/cpython
...
git update-ref --no-deref refs/git-r3/dev-lang/python/2.7/__main__ 309fb90f6895c47e7b41df3d739db45e8ec136c9
fatal: update_ref failed for ref 'refs/git-r3/dev-lang/python/2.7/__main__': cannot update ref 'refs/git-r3/dev-lang/python/2.7/__main__': trying to write ref 'refs/git-r3/dev-lang/python/2.7/__main__' with nonexistent object 309fb90f6895c47e7b41df3d739db45e8ec136c9


If I additionally set EGIT_BRANCH="2.7", then git-r3_src_unpack() succeeds.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-03-18 09:17:58 UTC
commit 00f0ed296c7b145239ba53e57d58bdd1fa42afdd
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Sat Mar 18 10:16:12 2017
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Sat Mar 18 10:17:28 2017

    git-r3.eclass: Document EGIT_COMMIT* <=> EGIT_BRANCH, #612852
    
    Document the relation between EGIT_COMMIT* and EGIT_BRANCH variables.