summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorNick Owens <nick.owens@eero.com>2025-01-04 18:18:49 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-08 11:34:30 +0000
commitef7755749bb10e1f97774405b2695708b6cf36de (patch)
tree3695f057cd7a9fba0a1d6d40ee3e0bc915ec6742 /bitbake/bin
parentb242f0a0079bb1b9c19d663e144187af2fcc0605 (diff)
downloadpoky-ef7755749bb10e1f97774405b2695708b6cf36de.tar.gz
bitbake: git-make-shallow: use stdin mode
when there are many refs to delete, using xargs to exec git can take a very long time. make this faster by only running git update-ref with stdin mode. for a repo with over 34000 git tags this makes git-make-shallow finish in 2 seconds instead of 3 minutes for me. (Bitbake rev: 2b815e42ec074a7f8667bbfaccaa69fc4a0ba788) Signed-off-by: Nick Owens <nick.owens@eero.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/git-make-shallow4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/bin/git-make-shallow b/bitbake/bin/git-make-shallow
index 9de557c10e..8ad704fae5 100755
--- a/bitbake/bin/git-make-shallow
+++ b/bitbake/bin/git-make-shallow
@@ -115,8 +115,8 @@ def filter_refs(refs):
115 all_refs = get_all_refs() 115 all_refs = get_all_refs()
116 to_remove = set(all_refs) - set(refs) 116 to_remove = set(all_refs) - set(refs)
117 if to_remove: 117 if to_remove:
118 check_output(['xargs', '-0', '-n', '1'] + git_cmd + ['update-ref', '-d', '--no-deref'], 118 check_output(git_cmd + ['update-ref', '--no-deref', '--stdin', '-z'],
119 input=''.join(l + '\0' for l in to_remove)) 119 input=''.join('delete ' + l + '\0\0' for l in to_remove) + 'commit\0')
120 120
121 121
122def follow_history_intersections(revisions, refs): 122def follow_history_intersections(revisions, refs):