From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68D8AE9462E for ; Tue, 10 Feb 2026 11:30:04 +0000 (UTC) Subject: Re: [bitbake][lib/bb/fetch2/git.py] Re-introducing --prune option in fetch_cmd #bitbake To: bitbake-devel@lists.openembedded.org From: "Bruno Ferreira" X-Originating-Location: Porto, PT (78.137.195.170) X-Originating-Platform: Mac Firefox 147 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 10 Feb 2026 03:29:58 -0800 References: In-Reply-To: Message-ID: <660988.1770722998965341769@lists.openembedded.org> Content-Type: multipart/alternative; boundary="Wrwxa8R4zoYw2gIj9Ami" List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 10 Feb 2026 11:30:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18997 --Wrwxa8R4zoYw2gIj9Ami Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable >=20 > New fetcher configuration options aren't particularly welcome, as they > need documentation, tests, and create alternative code paths and > complexity. >=20 That confirms my initial expectations, thanks for clarifying it. >=20 > Perhaps it would help if you show the sequence of steps that leads to > breakage, as it's hard to tell from just the description above what > the problem is exactly. >=20 >=20 Sure. So first of all this is a git "problem" not a bitbake fetcher git.py = lib "problem". A developer created an upstream branch named "foo" with code changes and changed a recipe SRC_URI to use the following: SRC_URI =3D git://github.com/org/random-repo.git;protocol=3Dhttps;branch=3D= foo do_fetch task was able to fetch everything properly during recipe build, st= oring it in DL_DIR as expected. Second developer created the upstream branch "foo/bar" with code changes. Meanwhile the first developer deleted the branch "foo" upstream. The second developer updated the recipe to use the new branch: SRC_URI =3D git://github.com/org/random-repo.git;protocol=3Dhttps;branch=3D= foo/bar During do_fetch, git is not able to fetch the "foo/bar" branch as the paren= t reference "foo" no longer exists in the upstream repo (only exists on local) triggering the= error visible in the log.do_fetch >=20 > error: cannot lock ref 'refs/heads/foo/bar': 'refs/heads/foo' exists; > cannot create 'refs/heads/foo/bar' > From https://github.com/org/random-repo > ! [new branch] =C2=A0 =C2=A0 =C2=A0foo/bar -> foo/bar =C2=A0(unable to up= date local ref) >=20 If I add back the --prune option that was removed here ( https://git.yoctop= roject.org/poky/commit/?id=3D61931d14df3be5273a38008ae2dff2a60a7d9b02 ) , "= git fetch" will work with the following message will appear in log.do_fetch >=20 > From https://github.com/org/random-repo > - [deleted] =C2=A0 =C2=A0 =C2=A0 =C2=A0 (none) =C2=A0 =C2=A0 -> foo > * [new branch] =C2=A0 =C2=A0 =C2=A0foo/bar -> foo/bar > --Wrwxa8R4zoYw2gIj9Ami Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
New fetcher configuration options aren't particularly welcome, as they=
need documentation, tests, and create alternative code paths and
complexity.
 
That confirms my initial expectations, thanks for clarifying it.
 
Perhaps it would help if you show the sequence of steps that leads to<= br />breakage, as it's hard to tell from just the description above whatthe problem is exactly.
 
 
Sure. So first of all this is a git "problem" not a bitbake fetcher gi= t.py lib "problem".
 
A developer created an upstream branch named "foo" with code changesand changed a recipe SRC_URI to use the following:
 
 
do_fetch task was able to fetch everything properly during recipe buil= d, storing it in DL_DIR as expected.
 
Second developer created the upstream branch "foo/bar" with code chang= es.
Meanwhile the first developer deleted the branch "foo" upstream.
 
The second developer updated the recipe to use the new branch:
 
During do_fetch, git is not able to fetch the "foo/bar" branch as the = parent reference "foo"
no longer exists in the upstream repo (only exi= sts on local) triggering the error visible in the log.do_fetch
 
error: cannot lock ref 'refs/heads/foo/bar': 'refs/heads/foo' exists; = cannot create 'refs/heads/foo/bar'
From https://github.com/org/random-= repo
! [new branch]      foo/bar -> foo/bar  (u= nable to update local ref)

If I add back the --prune option that was removed here, "git fetch" will wo= rk with the following message
will appear in log.do_fetch
From https://github.com/org/random-repo
- [deleted]    =     (none)     -> foo
* [new branch]   &n= bsp;  foo/bar -> foo/bar
--Wrwxa8R4zoYw2gIj9Ami--