Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694494 - git-r3.eclass cannot disable fetching of sub-submodules
Summary: git-r3.eclass cannot disable fetching of sub-submodules
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: 2019-09-15 13:42 UTC by Konstantin (Qrator Labs)
Modified: 2020-01-10 18:27 UTC (History)
0 users

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


Attachments
0001-git-r3.eclass-Handle-recursive-submodules-in-EGIT_SU.patch (0001-git-r3.eclass-Handle-recursive-submodules-in-EGIT_SU.patch,3.70 KB, patch)
2019-11-13 14:08 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin (Qrator Labs) 2019-09-15 13:42:13 UTC
E.g. I have submodules in project tree location `contrib/` I want all of them to be fetched but some of them also have sub-submodules e.g. `contrib/foo/bar`

Reproducible: Always

Steps to Reproduce:
1. Choose a project with sub-submodules
2. Enable all submolules in ebuild via submodules_dir/* glob
3. Try different ways to disable sub-submodules like submodules-dir/*/*
Actual Results:  
All sub-submodules get fetched

Expected Results:  
Only submodules, but not sub-submodules are fetched
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-08 20:14:47 UTC
Would it be possible for you to point me to that project, or (even better) give me a test ebuild?
Comment 2 Konstantin (Qrator Labs) 2019-11-13 13:15:03 UTC
Sure, take a look at https://github.com/gentoo/gentoo/pull/12799 as example
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-13 13:49:51 UTC
Ok, I see the problem now.  The submodule fetching function is unaware of submodule path.  I need to fix that but I need a while to think how to do it best.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-13 14:08:39 UTC
Created attachment 595962 [details, diff]
0001-git-r3.eclass-Handle-recursive-submodules-in-EGIT_SU.patch

Could you test this patch, please?  It seems to do the correct thing for me but since it's a bit complex, I'd like to be sure.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-28 20:13:08 UTC
Ping.
Comment 6 Konstantin (Qrator Labs) 2019-12-30 13:18:49 UTC
Hi, sorry for the delay.
Yep, patch works for me. I have a few ideas to test with more include/exclude patterns in different orders, but anyway in general that works much better than before.
Comment 7 Larry the Git Cow gentoo-dev 2020-01-10 18:27:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23717189bcef73c1b4604282de58daaf14a17b43

commit 23717189bcef73c1b4604282de58daaf14a17b43
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-11-13 14:06:35 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-01-10 18:27:18 +0000

    git-r3.eclass: Handle recursive submodules in EGIT_SUBMODULES
    
    Match recursive submodules using their full paths rather than path
    relatively to the parent submodule.
    
    Closes: https://bugs.gentoo.org/694494
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/git-r3.eclass | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)