Skip to contentSkip to conversation

bitbake-setup update problem

DISCUSSION Vyacheslav Yurkov 4 participants 11 messages Dec 22, 2025 – Jan 29 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

It turned out to be a painful discovery.
I wanted to rebase my custom branch in oe-core on top of latest master before publishing a set of patches. But it seems like after running 'bitbake-setup update' my branch is nowhere to be seen. Is it supposed to be like that? Any chance to get it restored?

Regards,
Slava

#1 lore raw
Quoted 6 lines · Vyacheslav Yurkov via lists.openembedded.org

It turned out to be a painful discovery.
I wanted to rebase my custom branch in oe-core on top of latest master before publishing a set of patches. But it seems like after running 'bitbake-setup update' my branch is nowhere to be seen. Is it supposed to be like that? Any chance to get it restored?

Try "git reflog HEAD", you should see every commit HEAD has been on (and, in theory, the commit at the tip of your branch)

Quoted 15 lines

Regards,
Slava

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#18631):
https://lists.openembedded.org/g/bitbake-devel/message/18631
Mute This Topic: https://lists.openembedded.org/mt/116898936/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw
Quoted 13 lines · Yoann Congal

Le lun. 22 déc. 2025 à 09:56, Vyacheslav Yurkov via lists.openembedded.org <http://lists.openembedded.org> <[email protected]> a écrit :

It turned out to be a painful discovery.
I wanted to rebase my custom branch in oe-core on top of latest master
before publishing a set of patches. But it seems like after running 'bitbake-setup update' my branch is nowhere to be seen. Is it supposed
to be like that? Any chance to get it restored?

Quoted 1 line

Try "git reflog HEAD", you should see every commit HEAD has been on (and, in theory, the commit at the tip of your branch)

That's the first thing I'd tried. The whole layer seems to be a fresh clone.

Slava

#3 lore raw
Quoted 4 lines · Vyacheslav Yurkov via lists.openembedded.org

Try "git reflog HEAD", you should see every commit HEAD has been on (and, in theory, the commit at the tip of your branch)

That's the first thing I'd tried. The whole layer seems to be a fresh clone.

Sadly yes, this is how bitbake's git fetcher performs unpack(). It's a forced overwrite, with no consideration for whether there have been local changes. We do need a guard in bb-setup for this, I guess the good one would check the revision that was previously unpacked (it's written into config/sources-fixed-revisions.json), and if the revision in the actual layer doesn't match then it would ask the user in the same way that it asks about making build/conf/ changes.

Alex

#5 lore raw
In reply to a message not in the archive
Quoted 7 lines · Alexander Kanavin via lists.openembedded.org

Sadly yes, this is how bitbake's git fetcher performs unpack(). It's a forced overwrite, with no consideration for whether there have been local changes. We do need a guard in bb-setup for this, I guess the good one would check the revision that was previously unpacked (it's written into config/sources-fixed-revisions.json), and if the revision in the actual layer doesn't match then it would ask the user in the same way that it asks about making build/conf/ changes.

If the revision does match, it should also check if there are additional local branches. If either is true then ask to choose one of:
1. Stop the update right now.
2. Move the existing layer directory to a backup location.

Alex

#7 lore raw
In reply to a message not in the archive
Quoted 8 lines · Alexander Kanavin via lists.openembedded.org
Quoted 7 lines

Sadly yes, this is how bitbake's git fetcher performs unpack(). It's a forced overwrite, with no consideration for whether there have been local changes. We do need a guard in bb-setup for this, I guess the good one would check the revision that was previously unpacked (it's written into config/sources-fixed-revisions.json), and if the revision in the actual layer doesn't match then it would ask the user in the same way that it asks about making build/conf/ changes.

Quoted 5 lines

If the revision does match, it should also check if there are additional local branches. If either is true then ask to choose one of:
1. Stop the update right now.
2. Move the existing layer directory to a backup location.

I posted a patch which adds the local modifications check. Unfortunately I couldn't figure out how to check for additional local
branches: it checks only if there are uncommitted changes, or changes on the current branch. If you have ideas I'd appreciate (simply running 'git branch' and counting the lines does not work, as git fetcher's unpack first unpacks master, then checks out the final branch if necessary, so both one and two branches can mean no local modifications).

Alex

#9 lore raw
In reply to a message not in the archive
Quoted 8 lines · Alexander Kanavin via lists.openembedded.org

I posted a patch which adds the local modifications check. Unfortunately I couldn't figure out how to check for additional local
branches: it checks only if there are uncommitted changes, or changes on the current branch. If you have ideas I'd appreciate (simply running 'git branch' and counting the lines does not work, as git fetcher's unpack first unpacks master, then checks out the final branch if necessary, so both one and two branches can mean no local modifications).

The more I think about it, the more I'm convinced git repositories managed by bitbake-setup should have a commit hook that prevents making commits altogether and tells users to use 'bitbake-setup init -L repo local-path'.

The local modifications check should remain, to guard for cases where there are uncommitted changes.

I'll make a v3.

Alex

#10 lore raw
Quoted 17 lines · Alexander Kanavin
Quoted 8 lines · Alexander Kanavin via lists.openembedded.org

I posted a patch which adds the local modifications check. Unfortunately I couldn't figure out how to check for additional local
branches: it checks only if there are uncommitted changes, or changes on the current branch. If you have ideas I'd appreciate (simply running 'git branch' and counting the lines does not work, as git fetcher's unpack first unpacks master, then checks out the final branch if necessary, so both one and two branches can mean no local modifications).

The more I think about it, the more I'm convinced git repositories managed by bitbake-setup should have a commit hook that prevents making commits altogether and tells users to use 'bitbake-setup init -L repo local-path'.

Quoted 6 lines

The local modifications check should remain, to guard for cases where there are uncommitted changes.

I'll make a v3.

Alex

This is why I don't like 'repo' and other wrappers that require that. I don't want to use another tool on top of git.

Slava

#11 lore raw
Quoted 28 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Vyacheslav Yurkov via lists.openembedded.org
Sent: den 18 januari 2026 09:48
To: Alexander Kanavin <[email protected]>
Cc: [email protected]; Yoann Congal <[email protected]>
Subject: Re: [bitbake-devel] bitbake-setup update problem

Quoted 20 lines · Alexander Kanavin
Quoted 8 lines · Alexander Kanavin via lists.openembedded.org

I posted a patch which adds the local modifications check. Unfortunately I couldn't figure out how to check for additional local
branches: it checks only if there are uncommitted changes, or changes on the current branch. If you have ideas I'd appreciate (simply running 'git branch' and counting the lines does not work, as git fetcher's unpack first unpacks master, then checks out the final branch if necessary, so both one and two branches can mean no local modifications).

The more I think about it, the more I'm convinced git repositories managed by bitbake-setup should have a commit hook that prevents making commits altogether and tells users to use 'bitbake-setup init -L repo local-path'.

The local modifications check should remain, to guard for cases where there are uncommitted changes.

Quoted 8 lines
Quoted 3 lines

I'll make a v3.

Alex

This is why I don't like 'repo' and other wrappers that require that. I don't want to use another tool on top of git.

Slava

I'm not sure why you are pointing at repo here, because this is actually a use case that repo handles extremely well. We have been using repo for over ten years to maintain the manifests for all our builds, and (AFAIK) we have not had a single case of repo loosing any data due to doing an update.

What repo does is first, if there are uncommitted changes, then it will not update that specific repository until those changes have either been removed or committed. Second, it rebases all local commits during the update. This can of course result in a conflict, which then needs to be handled manually, just like any other Git conflict resolution. What's more, repo also handles a repository being removed and later readded without loosing any metadata. This is because repo actually does not keep most of Git's metadata in the .git directory for each repository, but rather in its own .repo directory. This allows for going back and forth in manifest revisions even when there are changes to which repositories are being checked out, without fear of losing any data.

//Peter

#12 lore raw
Quoted 6 lines · Peter Kjellerstedt

I'm not sure why you are pointing at repo here, because this is actually a use case that repo handles extremely well. We have been using repo for over ten years to maintain the manifests for all our builds, and (AFAIK) we have not had a single case of repo loosing any data due to doing an update.

Quoted 11 lines

What repo does is first, if there are uncommitted changes, then it will not update that specific repository until those changes have either been removed or committed. Second, it rebases all local commits during the update. This can of course result in a conflict, which then needs to be handled manually, just like any other Git conflict resolution. What's more, repo also handles a repository being removed and later readded without loosing any metadata. This is because repo actually does not keep most of Git's metadata in the .git directory for each repository, but rather in its own .repo directory. This allows for going back and forth in manifest revisions even when there are changes to which repositories are being checked out, without fear of losing any data.

There was some discussion at the yesterday's tech call: basically adding a 'non-destructive unpack' feature to bitbake's git fetcher would be most welcome, and then bitbake-setup could use it, and then the restriction on making commits could be reverted. Such a feature probably would work like the description above.

Unfortunately right now I'm swamped with some high priority autobuilder issues (and there's a large backlog of other bitbake-setup improvements to be reviewed and possibly adjusted from feedback that I would really want to get in before the freeze), so can't promise where and how it'll happen if it's left to me to implement.

Alex

#13 lore raw
In reply to Peter Kjellerstedt
Quoted 5 lines · Peter Kjellerstedt

I'm not sure why you are pointing at repo here, because this is actually a use case that repo handles extremely well. We have been using repo for over ten years to maintain the manifests for all our builds, and (AFAIK) we have not had a single case of repo loosing any data due to doing an update.

I didn't mean that it loses the data. I meant the need to run some other command _using_ repo so it is aware of what happens in the repository.

Slava