Bug 16297 - Cannot set a git repo as a git premirror
Summary: Cannot set a git repo as a git premirror
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 6.0
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.1
Assignee: Antonin Godard
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-05-22 13:48 UTC by Ross Burton
Modified: 2026-06-17 15:23 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2026-05-22 13:48:03 UTC
I have internal mirrors of the yocto git repositories, but I can't use them in fetches using PREMIRRORS. My expectation was that setting a git: URL premirror to a git: server is that it would do a git fetch from the new location:

PREMIRRORS:prepend = " \
    git://git.yoctoproject.org/.*     git://internal/mirrors/yoctoproject/ \
    git://git.openembedded.org/.*     git://internal/mirrors/openembedded/ \
    "

This absolutely did the wrong thing and tried to clone git://internal/mirrors/yoctoproject.

Reading the source told me about magic symbols so I changed the line to

  git://git.yoctoproject.org/.* git://internal/mirrors/yoctoproject/BASENAME \

This mostly does the right thing, but it does use the mirror URL in the paths:

  Cloning into bare repository '.../downloads/git2/internal.mirrors.yoctoproject.linux-yocto.git'...

I initially started to file a bug before discovering BASENAME so now I'm thinking we need to:
1) at least document the symbols better
2) consider if a git premirror should use the final or stated url as the filename
Comment 1 Randy MacLeod 2026-05-28 14:44:37 UTC
Antonin can you work with Ross to document this issue/limitation?
Comment 2 Antonin Godard 2026-06-01 13:23:14 UTC
Patch sent to hopefully clarify this: https://lore.kernel.org/r/20260601-clarify-mirrors-syntax-v1-1-d9dbdbaf037f@bootlin.com