Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: "Bruno Ferreira" <srbruno@gmail.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake][lib/bb/fetch2/git.py] Re-introducing --prune option in fetch_cmd #bitbake
Date: Tue, 10 Feb 2026 03:29:58 -0800	[thread overview]
Message-ID: <660988.1770722998965341769@lists.openembedded.org> (raw)
In-Reply-To: <CANNYZj-pfZ79Uedy0-SNX5Go_gOWy0XpSQDgp7C1a8=kUAPdLw@mail.gmail.com>

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

> 
> 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
> breakage, as it's hard to tell from just the description above what
> the problem is exactly.
> 
> 

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 = git://github.com/org/random-repo.git;protocol=https;branch=foo

do_fetch task was able to fetch everything properly during recipe build, storing 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 = git://github.com/org/random-repo.git;protocol=https;branch=foo/bar

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 exists 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  (unable to update local ref)
> 

If I add back the --prune option that was removed here ( https://git.yoctoproject.org/poky/commit/?id=61931d14df3be5273a38008ae2dff2a60a7d9b02 ) , "git fetch" will work with the following message
will appear in log.do_fetch

> 
> From https://github.com/org/random-repo
> - [deleted]         (none)     -> foo
> * [new branch]      foo/bar -> foo/bar
>

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

  reply	other threads:[~2026-02-10 11:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-02-10 11:57     ` Alexander Kanavin
2026-02-19 10:35       ` Bruno Ferreira
2026-02-19 16:37         ` [bitbake-devel] " Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=660988.1770722998965341769@lists.openembedded.org \
    --to=srbruno@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox