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.
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.