diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e544589..469da6cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: run: | git config --global user.email "test@test.com" git config --global user.name "John Doe" - git config --global init.defaultBranch master # TODO: use main, need to adjust tests to match + git config --global init.defaultBranch main - name: Run tests run: phpunit diff --git a/README.md b/README.md index 27520c0c..a32d90c9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ executed before or after the release of a new version. Installation ------------ ### Option 1: As a development dependency of your project -In order to use RMT in your project you should use [Composer](http://getcomposer.org/) to install it +To use RMT in your project you should use [Composer](http://getcomposer.org/) to install it as a dev-dependency. Just go to your project's root directory and execute: composer require --dev liip/rmt @@ -31,7 +31,7 @@ root folder. You can now start using RMT by executing: Once there, your best option is to pick one of the [configuration examples](#configuration-examples) below and adapt it to your needs. -If you are using a versioning tool, we recommend to add both Composer files (`composer.json` +If you are using a versioning tool, we recommend adding both Composer files (`composer.json` and `composer.lock`), the RMT configuration file(`.rmt.yml`) and the `RMT` executable script to it. The `vendor` directory should be ignored as it is populated when running `composer install`. @@ -62,9 +62,9 @@ directly `./rmt.phar` or run it by invoking it through PHP via `php rmt.phar`. For the usage substitute RMT with whatever variant you have decided to use. ### Option 4: As Drifter role -If your are using https://github.com/liip/drifter for your project, you just need three step +If you are using https://github.com/liip/drifter for your project, you just need three step * Activate the `rmt` role -* Re-run the provisionning `vagrant provision` +* Re-run the provisioning `vagrant provision` * Init RMT for your project `php /home/vagrant/.config/composer/vendor/liip/rmt/RMT` Usage @@ -122,13 +122,13 @@ RMT also support JSON configs, but we recommend using YAML. ### Branch specific config -Sometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the `master` branch. To do so, you have to place your default config into a root element named `_default`, then you can override parts of this default config for the -branch `master`. Example: +Sometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the `main` branch. To do so, you have to place your default config into a root element named `_default`, then you can override parts of this default config for the +branch `main`. Example: _default: version-generator: "simple" version-persister: "vcs-tag" - master: + main: pre-release-actions: [changelog-update] You can use the command `RMT config` to see the merge result between _default and your current branch. @@ -138,7 +138,7 @@ You can use the command `RMT config` to see the merge result between _default an Build-in version number generation strategies. * simple: This generator is doing a simple increment (1,2,3...) -* semantic: A generator which implements [Semantic versioning](http://semver.org) +* semantic: A generator, which implements [Semantic versioning](http://semver.org) * Option `allow-label` (boolean): To allow adding a label on a version (such as -beta, -rcXX) (default: *false*) * Option `type`: to force the version type * Option `label`: to force the label @@ -151,8 +151,8 @@ Build-in version number generation strategies. Class in charge of saving/retrieving the version number. * vcs-tag: Save the version as a VCS tag - * Option `tag-pattern`: Allow to provide a regex that all tag must match. This allow for example to release a version 1.X.X in a specific branch and to release a 2.X.X in a separate branch - * Option `tag-prefix`: Allow to prefix all VCS tag with a string. You can have a numeric versionning but generation tags such as `v_2.3.4`. As a bonus you can use a specific placeholder: `{branch-name}` that will automatically inject the current branch name in the tag. So use, simple generation and `tag-prefix: "{branch-name}_"` and it will generate tag like `featureXY_1`, `featureXY_2`, etc... + * Option `tag-pattern`: Allow to provide a regex that all tag must match. This allows for example to release a version 1.X.X in a specific branch and to release a 2.X.X in a separate branch + * Option `tag-prefix`: Allow to prefix all VCS tag with a string. You can have a numeric versioning but generation tags such as `v_2.3.4`. As a bonus you can use a specific placeholder: `{branch-name}` that will automatically inject the current branch name in the tag. So use, simple generation and `tag-prefix: "{branch-name}_"` and it will generate tag like `featureXY_1`, `featureXY_2`, etc... * changelog: Save the version in the changelog file * Option `location`: Changelog file name an location (default: *CHANGELOG*) @@ -166,9 +166,9 @@ Prerequisite actions are executed before the interactive part. * `display-last-changes`: display your last changes * `tests-check`: run the project test suite * Option `command`: command to run (default: *phpunit*) - * Option `timeout`: the number of seconds after which the command times out (default: *60.0*) + * Option `timeout`: the amount of seconds after which the command times out (default: *60.0*) * Option `expected_exit_code`: expected return code (default: *0*) -* `composer-json-check`: run a validate on the composer.json +* `composer-json-check`: run a validated on the composer.json * Option `composer`: how to run composer (default: *php composer.phar*) * `composer-stability-check`: will check if the composer.json is set to the right minimum-stability * Option `stability`: the stability that should be set in the minimum-stability field (default: *stable*) @@ -192,7 +192,7 @@ Actions can be used for pre or post release parts. * Option `file`: path from .rmt.yml to changelog file (default: *CHANGELOG*) * Option `dump-commits`: write all commit messages since the last release into the changelog file (default: *false*) - * Option `insert-at`: only for addTop formatter: Number of lines to skip from the + * Option `insert-at`: only for addTop formatter: Amount lines to skip from the top of the changelog file before adding the release number (default: *0*) * Option `exclude-merge-commits`: Exclude merge commits from the changelog (default: *false*) * `vcs-commit`: commit all files of the working copy (only use it with the @@ -200,13 +200,13 @@ Actions can be used for pre or post release parts. * Option `commit-message`: specify a custom commit message. %version% will be replaced by the current / next version strings. * `vcs-tag`: Tag the last commit * `vcs-publish`: Publish the changes (commits and tags) -* `composer-update`: Update the version number in a composer file (note that when using packagist.org, it is recommended to not have a tag in composer.json as the version is handle by version control tags) +* `composer-update`: Update the version number in a composer file (note that when using packagist.org, it is recommended to not have a tag in composer.json as the version is handled by version control tags) * `files-update`: Update the version in one or multiple files. For each file to update, please provide an array with * Option `file`: path to the file to update * Option `pattern`: optional, use to specify the string replacement pattern in your file. For example: `const VERSION = '%version%';` * `build-phar-package`: Builds a Phar package of the current project whose filename depends on the 'package-name' option and the deployed version: [package-name]-[version].phar - * Option `package-name`: the name of the generate package + * Option `package-name`: the name of the generated package * Option `destination`: the destination directory to build the package into. If prefixed with a slash, is considered absolute, otherwise relative to the project root. * Option `excluded-paths`: a regex of excluded paths, directly passed to the [Phar::buildFromDirectory](http://php.net/manual/en/phar.buildfromdirectory.php) method. Ex: `/^(?!.*cookbooks|.*\.vagrant|.*\.idea).*$/im` * Option `metadata`: an array of metadata describing the package. Ex author, project. Note: the release version is added by default but can be overridden here. @@ -228,7 +228,7 @@ Actions can be used for pre or post release parts. Extend it --------- -RMT is providing some existing actions, generators, and persisters. If needed you can add your own by creating a PHP script in your project, and referencing it in the configuration via it's relative path: +RMT is providing some existing actions, generators and persisters. If needed you can add your own by creating a PHP script in your project, and referencing it in the configuration via it's relative path: version-generator: "bin/myOwnGenerator.php" @@ -284,7 +284,7 @@ Most of the time, it will be easier for you to pick up an example below and adap prerequisites: [working-copy-check, display-last-changes] -### Using Git tags with prefix, semantic versioning, updating two files and pushing automatically +### Using Git tags with a prefix, semantic versioning, updating two files and pushing automatically vcs: git version-generator: semantic @@ -297,7 +297,7 @@ Most of the time, it will be easier for you to pick up an example below and adap - [app.ini, 'dynamic-version: %version%'] post-release-actions: [vcs-publish] -### Using semantic versioning on master and simple versioning on topic branches, markdown formatting for changelog +### Using semantic versioning on main and simple versioning on topic branches, markdown formatting for changelog _default: vcs: git @@ -308,8 +308,8 @@ Most of the time, it will be easier for you to pick up an example below and adap tag-prefix: "{branch-name}_" post-release-actions: [vcs-publish] - # This entry allow to override some parameters for the master branch - master: + # This entry allow to override some parameters for the main branch + main: prerequisites: [working-copy-check, display-last-changes] pre-release-actions: changelog-update: @@ -323,9 +323,15 @@ Most of the time, it will be easier for you to pick up an example below and adap version-generator: semantic version-persister: vcs-tag +### Changing the default-branch: + _default: + vcs: + name: git + default-branch: my-default-branch + Contributing ------------ -If you would like to help, by submitting one of your action scripts, generators, or persisters. Or just by reporting a +If you would like to help, by submitting one of your action scripts, generators or persisters. Or just by reporting a bug just go to the project page [https://github.com/liip/RMT](https://github.com/liip/RMT). If you provide a PR, try to associate it some unit or functional tests. See next section diff --git a/autoload.php b/autoload.php index 778cf7c2..013e9b1b 100644 --- a/autoload.php +++ b/autoload.php @@ -37,5 +37,5 @@ )); $loader->register(); } else { - throw new \Exception("Unable to find the an autoloader"); + throw new \Exception("Unable to find an autoloader"); } diff --git a/src/Liip/RMT/Command/BaseCommand.php b/src/Liip/RMT/Command/BaseCommand.php index f71c6e62..e3ad0ecd 100644 --- a/src/Liip/RMT/Command/BaseCommand.php +++ b/src/Liip/RMT/Command/BaseCommand.php @@ -82,7 +82,7 @@ public function loadContext(): void try { $branch = $vcs->getCurrentBranch(); } catch (\Exception $e) { - echo "\033[31mImpossible to read the branch name\033[37m"; + echo "\033[31mUnable to read the branch name\033[37m"; } if (isset($branch)) { $config = $configHandler->getConfigForBranch($branch); diff --git a/src/Liip/RMT/Command/InitCommand.php b/src/Liip/RMT/Command/InitCommand.php index 7e26aaec..adfeeb85 100644 --- a/src/Liip/RMT/Command/InitCommand.php +++ b/src/Liip/RMT/Command/InitCommand.php @@ -70,6 +70,13 @@ protected function configure(): void 'choices_shortcuts' => array('g' => 'git', 'h' => 'hg', 'n' => 'none'), 'default' => 'none', )), + new InformationRequest('main-branch', array( + 'description' => 'The default branch you want to use (select none if you are not using a VCS system)', + 'type' => 'choice', + 'choices' => array('main', 'master', 'none'), + 'choices_shortcuts' => array('m' => 'main', 'mst' => 'master', 'n' => 'none'), + 'default' => 'main', + )), new InformationRequest('generator', array( 'description' => 'The generator to use for version incrementing', 'type' => 'choice', @@ -153,18 +160,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Create the config file from a template $this->getOutput()->writeln("Creation of the config file {$this->configPath}"); - $template = $this->informationCollector->getValueFor('vcs') == 'none' ? + $template = $this->informationCollector->getValueFor('vcs') === 'none' ? __DIR__.'/../Config/templates/no-vcs-config.yml.tmpl' : __DIR__.'/../Config/templates/default-vcs-config.yml.tmpl' ; $config = file_get_contents($template); $generator = $this->informationCollector->getValueFor('generator'); foreach (array( - 'generator' => $generator == 'semantic-versioning' ? + 'generator' => $generator === 'semantic-versioning' ? 'semantic # More complex versionning (semantic)' : 'simple # Same simple versionning', 'vcs' => $this->informationCollector->getValueFor('vcs'), + 'main-branch' => $this->informationCollector->getValueFor('main-branch'), 'persister' => $this->informationCollector->getValueFor('persister'), - 'changelog-format' => $generator == 'semantic-versioning' ? 'semantic' : 'simple', + 'changelog-format' => $generator === 'semantic-versioning' ? 'semantic' : 'simple', ) as $key => $value) { $config = str_replace("%%$key%%", $value, $config); } diff --git a/src/Liip/RMT/Config/Handler.php b/src/Liip/RMT/Config/Handler.php index 83687f6b..e5c1780d 100644 --- a/src/Liip/RMT/Config/Handler.php +++ b/src/Liip/RMT/Config/Handler.php @@ -25,7 +25,7 @@ public function __construct($rawConfig = null, $projectRoot = null) public function getDefaultConfig() { return array( - 'vcs' => null, + 'vcs' => array(), 'prerequisites' => array(), 'pre-release-actions' => array(), 'version-generator' => null, @@ -69,7 +69,7 @@ protected function mergeConfig($branchName = null) } // Return custom branch config - if (isset($branchName) && isset($branchesConfig[$branchName])) { + if (isset($branchName, $branchesConfig[$branchName])) { return array_replace_recursive($baseConfig, $branchesConfig[$branchName]); } @@ -97,7 +97,6 @@ protected function normalize($config) // Same process but for list value elements foreach (array('prerequisites', 'pre-release-actions', 'post-release-actions') as $configKey) { foreach ($config[$configKey] as $key => $item) { - // Accept the element to be define by key or by value if (!is_numeric($key)) { if ($item == null) { @@ -142,7 +141,7 @@ protected function getClassAndOptions($rawConfig, $sectionName) } elseif (is_array($rawConfig)) { // Handling Yml corner case (see https://github.com/liip/RMT/issues/54) - if (count($rawConfig) == 1 && key($rawConfig) !== 'name') { + if (count($rawConfig) === 1 && key($rawConfig) !== 'name') { $name = key($rawConfig); $rawConfig = is_array(reset($rawConfig)) ? reset($rawConfig) : array(); $rawConfig['name'] = $name; @@ -157,7 +156,7 @@ protected function getClassAndOptions($rawConfig, $sectionName) $options = $rawConfig; } else { - throw new Exception("Invalid configuration for [$sectionName] should be a object name or an array with name and options"); + throw new Exception("Invalid configuration for [$sectionName] should be an object name or an array with name and options"); } return array('class' => $class, 'options' => $options); @@ -177,7 +176,7 @@ protected function findClass($name, $sectionName) return str_replace('.php', '', $lastPart); } else { - throw new \Liip\RMT\Exception("Impossible to open [$file] please review your config"); + throw new \Liip\RMT\Exception("Unable to open [$file] please review your config"); } } diff --git a/src/Liip/RMT/Config/templates/default-vcs-config.yml.tmpl b/src/Liip/RMT/Config/templates/default-vcs-config.yml.tmpl index 64c06da6..519cc35a 100644 --- a/src/Liip/RMT/Config/templates/default-vcs-config.yml.tmpl +++ b/src/Liip/RMT/Config/templates/default-vcs-config.yml.tmpl @@ -1,7 +1,9 @@ _default: # VCS CONFIG - vcs: %%vcs%% + vcs: + name: %%vcs%% + main-branch: %%main-branch%% # PREREQUISITES # Actions executed before any questions get asked to the user. @@ -24,8 +26,8 @@ _default: ask-confirmation: true # BRANCH SPECIFIC CONFIG -# On master, we override the general config -master: +# On %%main-branch%%, we override the general config +%%main-branch%%: version-generator: %%generator%% version-persister: vcs-tag: diff --git a/src/Liip/RMT/Information/InformationCollector.php b/src/Liip/RMT/Information/InformationCollector.php index d9335cfd..076655a4 100644 --- a/src/Liip/RMT/Information/InformationCollector.php +++ b/src/Liip/RMT/Information/InformationCollector.php @@ -71,7 +71,7 @@ public function registerRequests($list) public function registerStandardRequest($name) { - if (!in_array($name, array_keys(static::$standardRequests))) { + if (!array_key_exists($name, static::$standardRequests)) { throw new \Exception("There is no standard request named [$name]"); } if (!isset($this->requests[$name])) { @@ -162,7 +162,7 @@ public function getValueFor($requestName, $default = null) if ($this->hasRequest($requestName)) { return $this->getRequest($requestName)->getValue(); } else { - if (func_num_args() == 2) { + if (func_num_args() === 2) { return $default; } throw new \Exception("No request named $requestName"); diff --git a/test/Liip/RMT/Tests/Functional/ExternalTasksTest.php b/test/Liip/RMT/Tests/Functional/ExternalTasksTest.php index 350de104..7662b482 100644 --- a/test/Liip/RMT/Tests/Functional/ExternalTasksTest.php +++ b/test/Liip/RMT/Tests/Functional/ExternalTasksTest.php @@ -20,7 +20,7 @@ public function testInvalidScript(): void exec('./RMT release -n', $output); $output = implode("\n", $output); // $this->manualDebug(); - self::assertStringContainsString('Impossible to open', $output); + self::assertStringContainsString('Unable to open', $output); self::assertStringContainsString($scriptName, $output); } diff --git a/test/Liip/RMT/Tests/Functional/GitTest.php b/test/Liip/RMT/Tests/Functional/GitTest.php index b6bd7a79..e0781b2e 100644 --- a/test/Liip/RMT/Tests/Functional/GitTest.php +++ b/test/Liip/RMT/Tests/Functional/GitTest.php @@ -19,7 +19,7 @@ public function testInitialVersion(): void $this->createConfig('simple', 'vcs-tag', array('vcs' => 'git')); exec('./RMT release -n --confirm-first'); exec('git tag', $tags); -// $this->manualDebug(); + // $this->manualDebug(); self::assertEquals(array('1'), $tags); } @@ -76,6 +76,6 @@ public function testTagPrefixWithBranchNamePlaceHolder(): void exec('./RMT release -n --confirm-first'); exec('git tag', $tags); // $this->manualDebug(); - self::assertEquals(array('_master_1'), $tags); + self::assertEquals(sprintf('_%s_1', self::DEFAULT_FUNCTIONAL_BRANCH), $tags[0]); } } diff --git a/test/Liip/RMT/Tests/Functional/InitCommandTest.php b/test/Liip/RMT/Tests/Functional/InitCommandTest.php index d89ea3ba..1126fda0 100644 --- a/test/Liip/RMT/Tests/Functional/InitCommandTest.php +++ b/test/Liip/RMT/Tests/Functional/InitCommandTest.php @@ -20,22 +20,21 @@ public function testInitConfig(): void $configFile = '.rmt.yml'; unlink($configFile); self::assertFileDoesNotExist($configFile); - exec('./RMT init --configonly=n --vcs=git --generator=semantic-versioning --persister=vcs-tag -n'); - -// $this->manualDebug(); + exec(sprintf('./RMT init --configonly=n --vcs=git --main-branch=%s --generator=semantic-versioning --persister=vcs-tag -n', self::DEFAULT_FUNCTIONAL_BRANCH)); self::assertFileExists($configFile); $config = Yaml::parse(file_get_contents($configFile), true); $defaultConfig = $config['_default']; - $masterConfig = $config['master']; + $mainConfig = $config[self::DEFAULT_FUNCTIONAL_BRANCH]; - self::assertEquals('git', $defaultConfig['vcs']); + self::assertEquals('git', $defaultConfig['vcs']['name']); + self::assertEquals(self::DEFAULT_FUNCTIONAL_BRANCH, $defaultConfig['vcs']['main-branch']); self::assertEquals('simple', $defaultConfig['version-generator']); - self::assertEquals('semantic', $masterConfig['version-generator']); + self::assertEquals('semantic', $mainConfig['version-generator']); self::assertEquals(array('vcs-tag' => array('tag-prefix' => '{branch-name}_')), $defaultConfig['version-persister']); - self::assertEquals(array('vcs-tag' => array('tag-prefix' => '')), $masterConfig['version-persister']); + self::assertEquals(array('vcs-tag' => array('tag-prefix' => '')), $mainConfig['version-persister']); } } diff --git a/test/Liip/RMT/Tests/Functional/RMTFunctionalTestBase.php b/test/Liip/RMT/Tests/Functional/RMTFunctionalTestBase.php index 12b1499f..bb4e6726 100644 --- a/test/Liip/RMT/Tests/Functional/RMTFunctionalTestBase.php +++ b/test/Liip/RMT/Tests/Functional/RMTFunctionalTestBase.php @@ -17,6 +17,7 @@ class RMTFunctionalTestBase extends ForwardCompatibilityTestCase { protected $tempDir; + protected const DEFAULT_FUNCTIONAL_BRANCH = 'master'; protected function setUp(): void { @@ -30,7 +31,7 @@ protected function setUp(): void // Create the executable task inside $rmtDir = realpath(__DIR__ . '/../../../../../'); - exec("php $rmtDir/command.php init --configonly=n --generator=basic-increment --persister=vcs-tag --vcs=git"); + exec("php $rmtDir/command.php init --configonly=n --generator=basic-increment --persister=vcs-tag --vcs=git --main-branch=" . self::DEFAULT_FUNCTIONAL_BRANCH); } protected function createConfig($generator, $persister, $otherConfig = array()): void @@ -60,6 +61,7 @@ protected function tearDown(): void protected function initGit(): void { + exec('git config --global init.defaultBranch ' . self::DEFAULT_FUNCTIONAL_BRANCH); exec('git init'); exec('git add .'); exec('git commit -m "First commit"'); diff --git a/test/Liip/RMT/Tests/Unit/Config/HandlerTest.php b/test/Liip/RMT/Tests/Unit/Config/HandlerTest.php index b3375a12..388a21b6 100644 --- a/test/Liip/RMT/Tests/Unit/Config/HandlerTest.php +++ b/test/Liip/RMT/Tests/Unit/Config/HandlerTest.php @@ -139,7 +139,7 @@ public function testMerge(): void $method->setAccessible(true); self::assertEquals([ - 'vcs' => null, + 'vcs' => [], 'prerequisites' => [], 'pre-release-actions' => [], 'post-release-actions' => [], @@ -148,7 +148,7 @@ public function testMerge(): void ], $method->invokeArgs($configHandler, [])); self::assertEquals([ - 'vcs' => null, + 'vcs' => [], 'prerequisites' => [], 'pre-release-actions' => [], 'post-release-actions' => [], @@ -173,7 +173,7 @@ public function testMergeOptions(): void $method->setAccessible(true); self::assertEquals([ - 'vcs' => null, + 'vcs' => [], 'prerequisites' => [], 'pre-release-actions' => [], 'post-release-actions' => [], @@ -182,7 +182,7 @@ public function testMergeOptions(): void ], $method->invokeArgs($configHandler, [])); self::assertEquals([ - 'vcs' => null, + 'vcs' => [], 'prerequisites' => [], 'pre-release-actions' => [], 'post-release-actions' => [], @@ -227,6 +227,8 @@ public function getDataForTestingGetClassAndOptions(): array ['vcs', ['name' => 'git'], Git::class, []], // vcs: {name: git, opt1: val1} ['vcs', ['name' => 'git', 'opt1' => 'val1'], Git::class, ['opt1' => 'val1']], + // vcs: {name: git, default-branch: liip} + ['vcs', ['name' => 'git', 'default-branch' => 'liip'], Git::class, ['default-branch' => 'liip']], ['prerequisites_1', 'vcs-clean-check', 'Liip\RMT\Prerequisite\VcsCleanCheck', []], ]; } diff --git a/test/Liip/RMT/Tests/Unit/VCS/GitTest.php b/test/Liip/RMT/Tests/Unit/VCS/GitTest.php index d7b1a3d8..c25095d7 100644 --- a/test/Liip/RMT/Tests/Unit/VCS/GitTest.php +++ b/test/Liip/RMT/Tests/Unit/VCS/GitTest.php @@ -85,8 +85,6 @@ public function testGetCurrentBranch(): void self::assertEquals('master', $vcs->getCurrentBranch()); system('git checkout -b foo --quiet'); self::assertEquals('foo', $vcs->getCurrentBranch()); - exec('git checkout master --quiet'); - self::assertEquals('master', $vcs->getCurrentBranch()); } public function testGetCurrentBranchWhenNotInBranch(): void @@ -104,7 +102,7 @@ public function testChangeNoMergeCommits(): void $vcs = new Git(); exec('git checkout -b merge-branch --quiet'); exec('echo "text" > new-file && git add -A && git commit -m "First commit"'); - exec('git checkout master --quiet'); + exec('git checkout main --quiet'); exec('git merge --no-ff merge-branch'); $modifs = $vcs->getAllModificationsSince('1.1.0', false, true); @@ -119,7 +117,7 @@ public function testChangeWithMergeCommits(): void $vcs = new Git(); exec('git checkout -b merge-branch --quiet'); exec('echo "text" > new-file && git add -A && git commit -m "First commit"'); - exec('git checkout master --quiet'); + exec('git checkout main --quiet'); exec('git merge --no-ff merge-branch'); $modifs = $vcs->getAllModificationsSince('1.1.0');