summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject-gitupdate.cmake.in
Commit message (Collapse)AuthorAgeFilesLines
* ExternalProject: Move existing step scripts to separate subdirectoryCraig Scott2022-01-221-277/+0
| | | | | This is in preparation for moving more inline content to separate scripts as well. Having them in a separate subdirectory is consistent with other modules and will make them easier to find and work with.
* ExternalProject: Use ${ref}^0 to avoid MSYS/Cygwin shell substitutionsCraig Scott2021-06-201-1/+1
| | | | | | | | | | | In 5e941a545b (ExternalProject: Ensure git fetch if updating to hash we don't have yet, 2021-05-09), the form ${ref}^{commit} was used to ensure the ref was treated as a commit. When running under a MSYS2 or Cygwin shell, the {commit} part can be translated by the shell, leaving it as ${ref}^commit, which git doesn't understand. Use the equivalent but safer form ${ref}^0, since it won't be subject to the shell substitution issue. Fixes: #22299
* ExternalProject: Ensure git fetch if updating to hash we don't have yetCraig Scott2021-05-091-1/+1
| | | | | | | | | | | In ac6a4d4884 (ExternalProject: Improve robustness of update step, 2020-10-17), the method used to check whether we already have a commit or not was changed from using git rev-list to git rev-parse. The new logic assumed rev-parse would output nothing if given a commit hash it didn't know about, but it simply prints the hash again without raising an error in this scenario. Amend that logic by adding ^{commit} to the ref to ensure we do get an error if that ref is not currently known. Fixes: #22166
* Revert ExternalProject and FetchContent refactoringCraig Scott2021-03-091-0/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring of the ExternalProject and FetchContent modules moved the commands into CMake scripts. This broke custom commands that used shell redirection or special build tool variables of the form $(MakeVar). Undo the sequence of commits that performed this refactoring and follow-up fixes associated with it. The following commits are reverted by this change: 4f3d1abbb4 (ExternalProject: Refactor pre-configure steps to support no-target uses, 2021-02-05) 17e5516e60 (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29) bd876f3849 (FetchContent: Restore patch command support, 2021-02-18) 404cddb7bb (ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks, 2021-02-21) b0da671243 (FetchContent: Don't update timestamps if files don't change, 2021-02-18) Fixes: #21892
* ExternalProject: Refactor pre-configure steps to support no-target usesCraig Scott2021-02-041-277/+0
| | | | | | | | | | | | | | | | | | | | | | The mkdir, download, update and patch steps are used by FetchContent during the configure phase of the main build. Because these steps need a target, this has so far required a sub-build to be set up. The changes here factor out the preparation of the scripts from the creation of the targets, allowing future work to leverage these steps without a sub-build (see #21703). As part of the refactoring, some rationalisation of the stamp files, repository info files and script names was done to make things more consistent between download methods and step implementations. Every download method now records its own specific repository info in a file and that file is a dependency of the download step. The source directory is also written to that file, so if the SOURCE_DIR changes, the download will be retriggered (the existing implementation fails in this scenario). Each download method now also has just one driver script that implements the whole step (it may pull in other scripts to do its task though). The patch step gained support for USES_TERMINAL as a result of generalising the implementation for custom commands. Fixes: #21748
* ExternalProject: Improve robustness of update stepCraig Scott2021-01-281-172/+233
| | | | | | | | | | | | | | | | | | Refactor the update logic to make it easier to follow. The following fixes/improvements are some consequences of this change: * Absorb a confusing git checkout failure message when the failure is allowed and we act on that failure appropriately. * Fix an unnecessary fetch in some scenarios when checking out a git hash we already have locally. * Stash and restore any local changes even when not rebasing. * Avoid unsafe rebasing where we are not on a branch that is already tracking the requested branch. * When fetching, use --tags --force to ensure we get all the tags and commits leading up to them regardless of whether the tags are on branches or not. Also update our local tags if they move on the remote. Fixes: #20677
* ExternalProject: Remote checkout needs to include the remote nameCraig Scott2020-05-291-53/+64
| | | | | | | | | | Commit 0aea435aa1 (ExternalProject: Provide choice of git update strategies, 2020-02-12) added the git update strategies, but the CHECKOUT strategy was not handling remote refs correctly. The local ref would be checked out instead and no warning or error would have been emitted. The test that should have caught this was also malformed and did not actually move the local master branch as intended.
* ExternalProject: Provide choice of git update strategiesCraig Scott2020-05-231-9/+49
| | | | | Fixes: #16528 Co-Authored-By: Michael Wake <macwake@gmail.com>
* ExternalProject: factor out gitupdate step to separate fileCraig Scott2020-05-231-0/+165
The refactoring exposed that the original implementation was referring to an undefined variable src_name, which was previously only used in error messages. This has been fixed as part of the refactoring work. Fixes: #20336