Created attachment 2874 [details] Patch to add branch functionality to buildhistory.class It would be useful if buildhistory supported branches for the git repository. That way the same git repo could be used to track changes for multiple build environments. Buildhistory for different build environments is not related hence using the same repo is not feasible as they have a separate history. The attached patch suggests an improvement to the buildhistory class by introducing the variable BUILDHISTORY_BRANCH which defaults to master. If the variable is set to anything else but master then an orphaned branch is created (BUILDHISTORY_COMMIT must be set to 1 of course). All changes are then committed to that branch. Orphan branches are used because buildhistory of different build environments typically do not share a common history. If changes are pushed to a remote repository BUILDHISTORY_BRANCH is used as well.
The patch looks mostly OK except there's no reason given in the commit message as to why you've broken out committing metadata-revs to a separate commit, and that does not seem to be related to the branch support. The idea with the way it's currently implemented was that any given commit would always have the correct metadata-revs associated with it, but we wouldn't have any additional noise introduced in the commits. Note for the future - patches like this should really be sent to the mailing list for review rather than being attached to bug reports.
Also not mentioned are the tweaks to initialising the repo - these look OK but should really be done in a separate commit.
Rudi, I'm assigning this back to you - could you please make the requested changes and then send this patch to the OE-Core mailing list? Thanks.
Sorry, I have been mia due to many other commitments. I will make the suggested changes and adapt the patch to work with master. I saw that the code has somewhat changed since I first submitted the patch.
Thsi looks very similar to code we have on the autobuilder helper and Joshua has also worked-around the issue.
Bulk move from 4.99 or 0.00 to 5.99
In yocto-autobuilder-helper.git on master ❯ fd buildhist scripts/buildhistory-init ❯ cat scripts/buildhistory-init #!/bin/sh # # Initialize Buildhistory for this branch .... similar idea but not in oe-core and IMO not quite what this ticket is asking.