Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [bitbake][lib/bb/fetch2/git.py] Re-introducing --prune option in fetch_cmd #bitbake
@ 2026-02-09 16:32 Bruno Ferreira
  2026-02-09 16:56 ` [bitbake-devel] " Alexander Kanavin
  0 siblings, 1 reply; 6+ messages in thread
From: Bruno Ferreira @ 2026-02-09 16:32 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

Hi,

In my current project we have several repositories where developers use git branch references in the format:

> 
> /remotes/origin/foo
> /remotes/origin/foo/bar
> 

And sometimes parent references, e.g: "/remotes/origin/foo" get deleted from the upstream repository leading to git fetch issues.

> 
> error: cannot lock ref 'refs/heads/foo/bar': 'refs/heads/foo' exists;
> cannot create 'refs/heads/foo/bar'
> 

Typically, the way git handles these cases is by adding the *--prune* option to delete the stale references from the local references and fetching would work.

While investigating what bitbake currently does during fetching for git repositories I've found the current fetch command ( https://git.yoctoproject.org/poky/tree/bitbake/lib/bb/fetch2/git.py?h=scarthgap#n459 ) in the past had the --prune option ( https://git.yoctoproject.org/poky/commit/?id=61931d14df3be5273a38008ae2dff2a60a7d9b02 )
but it was removed due to breaking old releases.

My first question is, is it ok to bring back the *--prune* option to *fetch_cmd* or this will still be an issue and it will brake old releases?

Second question, if introducing *--prune* again is not an option, what would be the recommend approach to introduce this setting via a configuration option on git.py lib?

Thank you,
B.

[-- Attachment #2: Type: text/html, Size: 2751 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-19 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 16:32 [bitbake][lib/bb/fetch2/git.py] Re-introducing --prune option in fetch_cmd #bitbake Bruno Ferreira
2026-02-09 16:56 ` [bitbake-devel] " Alexander Kanavin
2026-02-10 11:29   ` Bruno Ferreira
2026-02-10 11:57     ` [bitbake-devel] " Alexander Kanavin
2026-02-19 10:35       ` Bruno Ferreira
2026-02-19 16:37         ` [bitbake-devel] " Peter Kjellerstedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox