mbox series

[00/15] fetch2: gitsm: rework and simplify

Message ID 20250902064515.30879-1-stefan.herbrechtsmeier-oss@weidmueller.com
Headers show
Series fetch2: gitsm: rework and simplify | expand

Message

Stefan Herbrechtsmeier Sept. 2, 2025, 6:44 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

The patch series rework and simplify the git submodule fetcher. It moves
the properties of the git submodules into the URL and uses a single
private fetch object for all git submodule URLs. The series minimizes
the line numbers of the individual fetch methods and moves the git
submodules details into the parse function. At the end all methods of
the gitsm fetcher class call the corresponding methods of the git
fetcher and the private fetcher object. Only the unpack method contains
git submodule specific code.

The series is a preparation and motivation for the support of implicit
URLs inside the fetcher. The follow up series will remove most methods
inside the gitsm fetcher and only leaves the parsing of the git
submodules and the unpack functionality. Additionally, it allows the
gitsm fetcher to use the premirror only. The current implementation
leads to problems because the download of the git modules is triggered
via the download method with is called deeply inside the fetcher code.


Stefan Herbrechtsmeier (15):
  tests: fetch: add test case for local paths
  fetch2: support URL rev paramter for named URLs together with default
  fetch2: git: replace destdir variable with function
  fetch2: gitsm: remove dead code
  fetch2: gitsm: remove redundant set value
  fetch2: gitsm: remove needless SRCREV_FORMAT override
  fetch2: gitsm: use rev URL parameter instead of SRCREV variable
  fetch2: gitsm: remove duplicate code
  fetch2: gitsm: use subdir parameter for submodule
  fetch2: gitsm: add parentdir parameter
  fetch2: gitsm: handle submodules inside submodule unpack
  fetch2: gitsm: remove redundant check
  fetch2: gitsm: remove useless need_update check
  fetch2: gitsm: use TemporaryDirectory instead of mkdtemp
  fetch2: gitsm: remove indirection and nesting

 lib/bb/fetch2/__init__.py |   7 +-
 lib/bb/fetch2/git.py      |  25 +++---
 lib/bb/fetch2/gitannex.py |  10 ++-
 lib/bb/fetch2/gitsm.py    | 166 +++++++++++++-------------------------
 lib/bb/tests/fetch.py     |  21 +++++
 5 files changed, 105 insertions(+), 124 deletions(-)