Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 536534 - git-r3.eclass should support fetching repository with submodule with no HEAD
Summary: git-r3.eclass should support fetching repository with submodule with no HEAD
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-13 21:23 UTC by Denis
Modified: 2016-10-22 20:57 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 Denis 2015-01-13 21:23:17 UTC
Bare git repositories may have no HEAD, it happens sometimes.

It's ok when we have such repository in our EGIT_REPO_URI since it's enough to set some valid EGIT_BRANCH to avoid a fetching error "fatal: Couldn't find remote ref HEAD". It works even if we want to work with the particular commit and have set EGIT_COMMIT -- they work together perferctly.

The problem raises when the main repository has a submodule and this submodule's repository doesn't have any HEAD. This is what git-r3 does not expect and it doesn't allow to eigher turn off submodule loading (if it's not needed) or to set some branch to be looked at instead of the HEAD.

So, I propose to change the logic of fetching in case fetched repository has no HEAD but still has some branch.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-25 17:34:05 UTC
Could you point me to an ebuild I could use to test this?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-25 17:41:11 UTC
Possibly the fix from bug #524146 could solve this as well.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-26 10:25:55 UTC
Expanding on this, it looks weird to me. AFAIR HEAD on a bare repository specifies the default branch to fetch, so what is fetched when you want to clone it? Does git have some implicit fallback to 'master'? Should we maybe do a full mirror-style clone in this scenario?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-22 20:57:00 UTC
I'm closing due to lack of reply. Please reopen when you can provide the details needed for testing this.