public inbox for bitbake-devel@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Barker <paul@pbarker.dev>
To: Osama Abdelkader <osama.abdelkader@gmail.com>,
	 bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] bitbake-layers: layerindex-fetch: respect --branch for already-configured layers
Date: Mon, 08 Dec 2025 21:40:05 +0000	[thread overview]
Message-ID: <8d1e305bcbc688ca77aa88284bb8be982554971f.camel@pbarker.dev> (raw)
In-Reply-To: <20251101135651.26560-1-osama.abdelkader@gmail.com>

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

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2025-12-08 21:40 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 [this message]
2025-12-11 22:12   ` Osama Abdelkader

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