'engine is specified by the current project.',
'example' => '"ExampleUnitTestEngine"',
),
+ 'arc.feature.start.default' => array(
+ 'type' => 'string',
+ 'help' =>
+ 'The name of the default branch to create the new feature branch '.
+ 'off of.',
+ 'example' => '"develop"',
+ ),
'arc.land.onto.default' => array(
'type' => 'string',
'help' =>
'`arc land` is run.',
'example' => '"develop"',
),
+ 'arc.land.update.default' => array(
+ 'type' => 'string',
+ 'help' =>
+ 'The default strategy to use when arc land updates the feature '.
+ 'branch. Supports \'rebase\' and \'merge\' strategies.',
+ 'example' => '"rebase"',
+ ),
'history.immutable' => array(
'type' => 'bool',
'legacy' => 'immutable_history',
),
),
'update-with-rebase' => array(
- 'help' => 'When updating the feature branch, use rebase intead of '.
- 'merge. This might make things work better in some cases.',
+ 'help' => 'When updating the feature branch, use rebase instead of '.
+ 'merge. This might make things work better in some cases.'.
+ 'Set arc.land.update.default to \'rebase\' to make this '.
+ 'default.',
'conflicts' => array(
'merge' => 'The --merge strategy does not update the feature branch.',
+ 'update-with-merge' => 'Cannot be used with --update-with-merge.',
+ ),
+ 'supports' => array(
+ 'git',
+ ),
+ ),
+ 'update-with-merge' => array(
+ 'help' => 'When updating the feature branch, use merge instead of '.
+ 'rebase. This is the default behavior. '.
+ 'Setting arc.land.update.default to \'merge\' can also '.
+ 'be used to make this the default.',
+ 'conflicts' => array(
+ 'merge' => 'The --merge strategy does not update the feature branch.',
+ 'update-with-rebase' => 'Cannot be used with --update-with-rebase.',
+ ),
+ 'supports' => array(
+ 'git',
),
),
'revision' => array(
}
$this->branch = head($branch);
$this->keepBranch = $this->getArgument('keep-branch');
- $this->shouldUpdateWithRebase = $this->getArgument('update-with-rebase');
+
+ $working_copy = $this->getWorkingCopy();
+ $update_strategy = $working_copy->getConfigFromAnySource(
+ 'arc.land.update.default',
+ 'merge');
+ $this->shouldUpdateWithRebase = $update_strategy == 'rebase';
+ if ($this->getArgument('update-with-rebase')) {
+ $this->shouldUpdateWithRebase = true;
+ } else if ($this->getArgument('update-with-merge')) {
+ $this->shouldUpdateWithRebase = false;
+ }
+
$this->preview = $this->getArgument('preview');
if (!$this->branchType) {
$onto_default = $this->isGit ? 'master' : 'default';
$onto_default = nonempty(
- $this->getWorkingCopy()->getConfigFromAnySource('arc.land.onto.default'),
+ $working_copy->getConfigFromAnySource('arc.land.onto.default'),
$onto_default);
$this->onto = $this->getArgument('onto', $onto_default);
$this->ontoType = $this->getBranchType($this->onto);