Gush\Command\PullRequest\PullRequestMergeCommand::configure PHP Method

configure() protected method

protected configure ( )
    protected function configure()
    {
        $this->setName('pull-request:merge')->setDescription('Merges the pull request given')->addArgument('pr_number', InputArgument::REQUIRED, 'Pull Request number')->addArgument('pr_type', InputArgument::OPTIONAL, 'Pull Request type eg. bug, feature (default is merge)')->addOption('no-comments', null, InputOption::VALUE_NONE, 'Avoid adding PR comments to the merge commit message')->addOption('fast-forward', null, InputOption::VALUE_NONE, 'Merge pull-request using fast forward (no merge commit will be created)')->addOption('squash', null, InputOption::VALUE_NONE, 'Squash the PR before merging')->addOption('force-squash', null, InputOption::VALUE_NONE, 'Force squashing the PR, even if there are multiple authors (this will implicitly use --squash)')->addOption('switch', null, InputOption::VALUE_REQUIRED, 'Switch the base of the pull request before merging')->addOption('pat', null, InputOption::VALUE_REQUIRED, 'Give the PR\'s author a pat on the back after the merge')->setHelp(<<<'EOF'
The <info>%command.name%</info> command merges the given pull request:

    <info>$ gush %command.name% 12</info>

Optionally you can prefix the merge title with a type like: bug, feature or anything you like.
<comment>Using a type makes it easier to search for a such a PR-type in your git history.</comment>

    <info>$ gush %command.name% 12 bug</info>

If there are many unrelated commits (like cs fixes) you can squash all the commits in the
pull-request into one big commit using:

    <info>$ gush %command.name% --squash 12</info>

This will use the message-body and author of the first commit in the pull-request.

<comment>Note:</comment> Squashing a PR requires that all the commits in the pull-request were done by one author.
You can overwrite this behaviour with <comment>--force-squash</comment>

If the pull request was opened against the master branch as target, but you rather want to merge it into another branch,
like "development" you can use <comment>--switch</comment> to change the base when merging.

<comment>This will only merge the commits that are in the source branch but not in the original target branch!</comment>

    <info>$ gush %command.name% --switch=development 12</info>

Pull-requests are merged as non fast-forward, which means a merge-commit (or merge bubble) is
created when merging. But sometimes you would rather want to merge without creating a merge bubble.

To merge a pull-request as fast-forward (no merge-commit) use the <comment>--fast-forward</comment>
option. Note that no merge-message is available and the changes are merged as if they were created in
the target branch directly!

    <info>$ gush %command.name% --fast-forward 12</info>

After the pull request is merged, you can give a pat on the back to its author using the <comment>--pat</comment>.
This option accepts the name of any configured pat's name:

    <info>$ gush %command.name% --pat=thank_you 12</info>

If you omit it, you'll be prompted to choose one (default is <comment>none</comment>), but you can also choose to
not be prompted using <comment>--pat=none</comment>.
Additionally you can let gush use a random pat with <comment>--pat=random</comment>.

    <info>$ gush %command.name% --pat=random 12</info>

This option can be configured from your local <comment>.gush.yml</comment> file within this directive:
<comment>
pat_on_merge: thank_you # or null, none, random, etc.
</comment>

When this directive is configured, the configured pat will be used at least you use this <comment>--pat</comment> option,
which has precedence to the predefined configuration.

<comment>The whole pat configuration will be ignored and no pat will be placed if the pull request is authored by yourself!</comment>
EOF
);
    }