Files
qt5/cmake
Alexandru Croitor 89b1d7f86c CMake: Add support for a git qt-foreach subcommand for worktrees
Developers that use a top-level qt5.git can use git submodule foreach
to run commands for each submodule. That is not available to
developers that maintain their own non-submodule based top-level
checkout using git worktrees.

Extend the QtSynchronizeRepo.cmake script that allows to sync
submodules / worktrees to also allow running foreach commands.

The CMake invocation to run a foreach would look like

  cmake -DQT_FOREACH=TRUE "-DARGS=git pull -r" -P
    cmake/QtSynchronizeRepo.cmake

But it's nicer to create a git-qt-foreach script in
/usr/local/bin/git-qt-foreach with the following contents

 cmake -DQT_FOREACH=TRUE "-DARGS=$*" -P cmake/QtSynchronizeRepo.cmake

Make sure to chmod a+x it and invoke like

git qt-foreach git pull -r

Change-Id: I0ccd67facbfe702c6a872165cdfd9f9e6eae9043
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-27 10:44:08 +01:00
..