Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15313279
D20854.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
D20854.diff
View Options
diff --git a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
@@ -469,11 +469,26 @@
return phutil_split_lines($stdout, $retain_newlines = false);
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
if ($all_closing_heads) {
- list($stdout) = $this->getRepository()->execxLocalCommand(
- 'log --format=%s %s --not %Ls',
- '%H',
- $new_head,
- $all_closing_heads);
+
+ // See PHI1474. This length of list may exceed the maximum size of
+ // a command line argument list, so pipe the list in using "--stdin"
+ // instead.
+
+ $ref_list = array();
+ $ref_list[] = $new_head;
+ foreach ($all_closing_heads as $old_head) {
+ $ref_list[] = '^'.$old_head;
+ }
+ $ref_list[] = '--';
+ $ref_list = implode("\n", $ref_list)."\n";
+
+ $future = $this->getRepository()->getLocalCommandFuture(
+ 'log --format=%s --stdin',
+ '%H');
+
+ list($stdout) = $future
+ ->write($ref_list)
+ ->resolvex();
} else {
list($stdout) = $this->getRepository()->execxLocalCommand(
'log --format=%s %s',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 3:51 PM (2 d, 34 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7335548
Default Alt Text
D20854.diff (1 KB)
Attached To
Mode
D20854: Use "git log ... --stdin" instead of "git log ... --not ..." to avoid oversized command lines
Attached
Detach File
Event Timeline
Log In to Comment