Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13189208
D9854.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
D9854.diff
View Options
diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php
--- a/src/repository/api/ArcanistGitAPI.php
+++ b/src/repository/api/ArcanistGitAPI.php
@@ -1213,4 +1213,12 @@
$this->resolvedHeadCommit = null;
}
+ public function setSingleCommit($symbolic_commit) {
+ list($parent) = $this->execxLocal(
+ 'rev-list %s --skip=1 --max-count=1', $symbolic_commit);
+ $parent = rtrim($parent, "\n");
+ $this->setBaseCommit($parent);
+ $this->setHeadCommit($symbolic_commit);
+ }
+
}
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -182,6 +182,15 @@
'never-apply-patches' => '--nolint suppresses lint.',
),
),
+ 'commit' => array(
+ 'param' => 'revision_id',
+ 'help' => 'Single commit to generate diff from.',
+ 'conflicts' => array(
+ '--base' => '--commit suppresses --base.',
+ '--head' => '--commit suppresses --head.'
+ ),
+ 'supports' => array('git'),
+ ),
'only' => array(
'help' =>
'Only generate a diff, without running lint, unit tests, or other '.
@@ -450,6 +459,10 @@
}
$repo = $this->getRepositoryAPI();
+ if ($this->getArgument('commit')) {
+ $repo->setSingleCommit($this->getArgument('commit'));
+ }
+
$head_commit = $this->getArgument('head');
if ($head_commit !== null) {
$repo->setHeadCommit($head_commit);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 12, 5:47 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6290260
Default Alt Text
D9854.diff (1 KB)
Attached To
Mode
D9854: Add support for creating revision from existing git commit
Attached
Detach File
Event Timeline
Log In to Comment