[PATCH] kernel-yocto: Add KERNEL_SKIP_BRANCH_CONVERSION var to skip branch conversion from remote to local
From: Tomasz Dziendzielski <hidden>
Date: 2021-10-26 07:34:15
Subsystem:
the rest · Maintainer:
Linus Torvalds
Introduced poky upstream commit: 14df6d53b6 linux-yocto: improve checkout error handling and reporting converts all remote branches to local branches. Our Linux repo has ~4500 remote branches: git branch -a | grep remotes |wc -l -> 4575 This costs our best workstations ~20 minutes to simply do that conversion in do_kernel_checkout which is not needed (at least I do not see any benefit after testing with this patch). Since this conversion is required for some linux-yocto workflows we introduce variable that allows skipping this on demand. Signed-off-by: Tomasz Dziendzielski <redacted> Signed-off-by: Jan Brzezanski <redacted> Signed-off-by: Ricardo Rodrigues <redacted> Signed-off-by: Szymon Czarnuch <redacted> Signed-off-by: Kamil Kwiek <redacted> --- meta/classes/kernel-yocto.bbclass | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 1d5a8cdf29..68fb1af821 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass@@ -363,13 +363,15 @@ do_kernel_checkout() { cd ${S} # convert any remote branches to local tracking ones - for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do - b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; - git show-ref --quiet --verify -- "refs/heads/$b" - if [ $? -ne 0 ]; then - git branch $b $i > /dev/null - fi - done + if [ "${KERNEL_SKIP_BRANCH_CONVERSION}" != "1" ]; then + for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do + b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; + git show-ref --quiet --verify -- "refs/heads/$b" + if [ $? -ne 0 ]; then + git branch $b $i > /dev/null + fi + done + fi # Create a working tree copy of the kernel by checking out a branch machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
--
2.33.0