public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Paul Barker <paul@pbarker.dev>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] bitbake-layers: layerindex-fetch: respect --branch for already-configured layers
Date: Thu, 11 Dec 2025 23:12:19 +0100	[thread overview]
Message-ID: <aTtBw7g0_Cl6kmSy@osama> (raw)
In-Reply-To: <8d1e305bcbc688ca77aa88284bb8be982554971f.camel@pbarker.dev>

On Mon, Dec 08, 2025 at 09:40:05PM +0000, Paul Barker wrote:
> On Sat, 2025-11-01 at 15:56 +0200, Osama Abdelkader wrote:
> > [YOCTO #7852]
> > 
> > The layerindex-fetch command has two issues when --branch is specified:
> > 
> > 1. If a layer is already in bblayers.conf, the command exits early with
> >    "You already have the requested layer(s)" without checking if the
> >    layer is on the requested branch.
> > 
> > 2. For layers in bblayers.conf (cooker layers), the branch checking code
> >    added in commit 138dd7883ee (2022) never executes because cooker layers
> >    are skipped entirely in the fetch loop.
> > 
> > This patch fixes both issues by:
> > 
> > - Preventing the early exit (fast path) when --branch is specified, forcing
> >   branch verification even for already-configured layers.
> > 
> > - Adding branch check/switch logic for cooker layers when --branch is
> >   specified. The code finds each layer's git repository and calls
> >   get_fetch_layer() with the requested branch to perform the validation
> >   and checkout if needed.
> > 
> > - Fixing the branch detection in get_fetch_layer() to use
> >   'git rev-parse --abbrev-ref HEAD' instead of parsing 'git branch' output.
> > 
> > - Fixing undefined 'stderr' variable (should be 'completed_proc.stderr').
> > 
> > This completes the fix started in commit 138dd7883ee, allowing users to
> > use --branch to switch already-configured layers to different branches.
> > 
> > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> 
> Hi,
> 
> Thanks for the contribution! Apologies for the delay in reviewing it, we've
> been focused on finishing the 5.3 release.
> 
> This looks like a useful change but it's difficult to review in its current
> form. Could you split this into multiple commits? Based on the above detail
> there are 4 different logical changes here so we would prefer each of those as
> a separate patch.
> 
> I'd especially like the completed_proc.stderr fix to be isolated as it
> may need to be backported to a stable release. So this fix should come
> first in the series - best practice is to put patches that fix bugs
> first, then patches that add features.
> 
> I think you'll also need to apply these changes to the bitbake
> repository rather than the poky repository to remove the unnecessary
> 'bitbake/' prefix on the file paths.
> 
> Best regards,
> 
> -- 
> Paul Barker

Thanks for the feedback, I'm going to that.
Best regards,
Osama



      reply	other threads:[~2025-12-11 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01 13:56 [PATCH] bitbake-layers: layerindex-fetch: respect --branch for already-configured layers Osama Abdelkader
2025-12-08 21:40 ` Paul Barker
2025-12-11 22:12   ` Osama Abdelkader [this message]

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=aTtBw7g0_Cl6kmSy@osama \
    --to=osama.abdelkader@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=paul@pbarker.dev \
    /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