Skip to content

devtool: fix standalone clone conversion for nested git repos

Jamin Lin openembedded-core 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 8 repliesIn review
  2. v35 patches 2 repliesSuperseded
  3. v23 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Changes in v4 from the cover letter

- Fix regression from v3:
setup_git_repo() now detects nested repos both for fresh workspace repos and for recipes whose source is already a git repo (fixes test_devtool_modify_nested_gitsm).

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5oe/patch: Skip commitIgnored when nothing is actually stagedmeta/lib/oe/patch.py+12 -02 replies
2/5devtool: Register nested git repos before the initial commitscripts/lib/devtool/__init__.py+56 -232 replies
3/5devtool-source: Make nested destsuffix git repos standalonemeta/classes/devtool-source.bbclass+16 -01 reply
4/5meta-selftest: Add devtool-test-multi-destsuffix recipemeta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb+27 -00 replies
5/5oeqa/selftest/devtool: Add test for multiple nested git destsuffix reposmeta/lib/oeqa/selftest/cases/devtool.py+64 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/5] devtool: fix standalone clone conversion for nested git repos

When a recipe has multiple git SRC_URI entries with destsuffix values nested inside S, devtool modify left all but the top-level repo with a .git/objects/info/alternates file pointing into the downloads cache.

Running 'bitbake -c cleanall' then removed those shared objects, breaking all subsequent git operations in the workspace.
Fix git_convert_standalone_clone() to walk all git repos nested inside S and repack each one to a fully standalone clone.

v1:
- Fix git_convert_standalone_clone() to walk all git repos nested inside S and repack each one to a standalone clone
v2:
- Add selftest recipe devtool-test-multi-destsuffix with six nested git SRC_URI entries to reproduce the scenario
- Add test_devtool_modify_multi_git_destsuffix_standalone to verify all nested repos have their alternates removed after devtool modify and remain usable after 'bitbake -c cleanall'
v3:
- Read SRC_URI directly instead of walking the tree for '.git' dirs - also fixes repos nested inside another repo's own working tree
- Fix setup_git_repo() to register nested repos as submodules before the initial commit (was dead code), processing bottom-up to avoid stale submodule references
- Fix commitIgnored() to skip committing when nothing is staged, so do_patch no longer fails on a submodule that's dirty only because of its own nested content
- Simplify test recipe to three genuinely-nested destsuffix entries (level1/level1/level2/level1/level2/level3), update selftest to match
v4:
- Fix regression from v3:
setup_git_repo() now detects nested repos both for fresh workspace repos and for recipes whose source is already a git repo (fixes test_devtool_modify_nested_gitsm).

Jamin Lin (5):
oe/patch: Skip commitIgnored when nothing is actually staged
devtool: Register nested git repos before the initial commit
devtool-source: Make nested destsuffix git repos standalone
meta-selftest: Add devtool-test-multi-destsuffix recipe oeqa/selftest/devtool: Add test for multiple nested git destsuffix
repos

 .../devtool-test-multi-destsuffix_git.bb      | 27 +++++++
 meta/classes/devtool-source.bbclass           | 16 ++++
 meta/lib/oe/patch.py                          | 12 +++
 meta/lib/oeqa/selftest/cases/devtool.py       | 64 +++++++++++++++
 scripts/lib/devtool/__init__.py               | 79 +++++++++++++------
 5 files changed, 175 insertions(+), 23 deletions(-)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-multi-destsuffix_git.bb
Signature · 1 line
2.43.0