Repository navigation
Allow gitlib 2 - #1235
Draft
lyrixx wants to merge 2 commits into
Draft
Allow gitlib 2#1235lyrixx wants to merge 2 commits into
lyrixx wants to merge 2 commits into
Conversation
gitlib 2 requires PHP 8.4, so grumphp supports both gitlib 1 and 2: it uses the API of gitlib 2 when it's installed, without its deprecations. - The repository is configured with a CliDriver instead of options. Its "inherit_environment_variables" option has no counterpart: git inherits the environment variables of PHP anyway, and Dotenv and the paths registrar write them to $_ENV or with putenv(). - The diff of the hooks is parsed with its repository. - The changed files are named by File::getName(), the new name of a renamed file with both versions: getNewName() is nullable in gitlib 2. - The specs no longer double the classes of gitlib, which are final in gitlib 2: they run on temporary git repositories instead. - The raw diff of the specs had spaces instead of a tab, and the status of a modification for a new file: gitlib 2 refuses it.
To drop once gitlib 2.0 is released: the highest dependencies on PHP 8.4 and 8.5 then install it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gitlib 2.0 is about to be released. This PR checks that grumphp can upgrade to it, before the release.
gitlib 2 requires PHP 8.4, so grumphp supports
^1.6 || ^2.0: it uses the API of gitlib 2 when it's installed, without triggering its deprecations, and keeps the API of gitlib 1 otherwise.Changes
GitRepositoryLocatorconfigures the repository with aCliDriver(logger included) instead of the options array, deprecated in gitlib 2.inherit_environment_variableshas no counterpart in gitlib 2: git inherits the environment variables of PHP anyway, and grumphp writes its own (Dotenv, paths) to$_ENVor withputenv().GitRepositorygets the logger instead of the options array.GitRepository::createRawDiff()gives the repository toDiff::parse()with gitlib 2:Diff::setRepository()is deprecated there.ChangedFilesnames a file withFile::getName(), which is the new name of a renamed file with both versions (getNewName()is nullable in gitlib 2).Repository,WorkingCopy,DiffandDiff\Fileare final in gitlib 2. They run on temporary git repositories (GrumPHPTest\Helpers\TemporaryGitRepository) instead.The lock file is unchanged (gitlib 1.6.0, platform PHP 8.2), apart from its hash.
Testing before gitlib 2.0 is released
The last commit (
[DO NOT MERGE]) installs the main branch of gitlib as2.0.0for thehighestjobs on PHP 8.4 and 8.5, both in grumphp and in the projects the E2E tests create. It has to be dropped before merging: once 2.0 is released, these jobs install it on their own.Locally, with gitlib 1.6.0 and with gitlib's main branch installed as 2.0.0:
v2.x(XmlLinterTestwith xinclude, depends on libxml)No deprecation of gitlib is triggered with gitlib 2.