Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14011793
D10443.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10443.diff
View Options
diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php
--- a/src/workflow/ArcanistPatchWorkflow.php
+++ b/src/workflow/ArcanistPatchWorkflow.php
@@ -105,6 +105,16 @@
'force' => array(
'help' => 'Do not run any sanity checks.',
),
+ 'keep-redundant-commits' => array(
+ 'supports' => array('git'),
+ 'help' =>
+ 'Normally, git will not allow you to cherry-pick empty commits, '.
+ 'however if you have dependent diffs where some of the '.
+ 'dependencies have landed into HEAD, then you might want to force '.
+ 'git to do so to be able to successfully patch dependent diffs. '.
+ 'This flag gets passed down to git cherry-pick which then cretes '.
+ 'empty commits for the dependencies.',
+ ),
'*' => 'name',
);
}
@@ -198,6 +208,10 @@
return true;
}
+ private function shouldKeepRedundantCommits() {
+ return $this->getArgument('keep-redundant-commits', false);
+ }
+
private function getBranchName(ArcanistBundle $bundle) {
$branch_name = null;
$repository_api = $this->getRepositoryAPI();
@@ -699,7 +713,13 @@
$repository_api->execxLocal('checkout %s', $original_branch);
$ex = null;
try {
- $repository_api->execxLocal('cherry-pick %s', $new_branch);
+ if ($this->shouldKeepRedundantCommits()) {
+ $repository_api->execxLocal(
+ 'cherry-pick --keep-redundant-commits %s',
+ $new_branch);
+ } else {
+ $repository_api->execxLocal('cherry-pick %s', $new_branch);
+ }
} catch (Exception $ex) {
// do nothing
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 2, 5:16 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6744996
Default Alt Text
D10443.diff (1 KB)
Attached To
Mode
D10443: Allow arc patch to keep empty commits
Attached
Detach File
Event Timeline
Log In to Comment