@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use "git log ... --stdin" instead of "git log ... --not ..." to avoid oversized command lines

Summary:
Depends on D20853. See PHI1474. If the list of "--not" refs is sufficiently long, we may exceed the maximum size of a command.

Use "--stdin" instead, and swap "--not" for the slightly less readable but functionally equivalent "^hash", which has the advantage of actually working with "--stdin".

Test Plan: Ran `bin/repository refs ...` with nothing to be done, and with something to be done.

Differential Revision: https://secure.phabricator.com/D20854

+20 -5
+20 -5
src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
··· 469 469 return phutil_split_lines($stdout, $retain_newlines = false); 470 470 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 471 471 if ($all_closing_heads) { 472 - list($stdout) = $this->getRepository()->execxLocalCommand( 473 - 'log --format=%s %s --not %Ls', 474 - '%H', 475 - $new_head, 476 - $all_closing_heads); 472 + 473 + // See PHI1474. This length of list may exceed the maximum size of 474 + // a command line argument list, so pipe the list in using "--stdin" 475 + // instead. 476 + 477 + $ref_list = array(); 478 + $ref_list[] = $new_head; 479 + foreach ($all_closing_heads as $old_head) { 480 + $ref_list[] = '^'.$old_head; 481 + } 482 + $ref_list[] = '--'; 483 + $ref_list = implode("\n", $ref_list)."\n"; 484 + 485 + $future = $this->getRepository()->getLocalCommandFuture( 486 + 'log --format=%s --stdin', 487 + '%H'); 488 + 489 + list($stdout) = $future 490 + ->write($ref_list) 491 + ->resolvex(); 477 492 } else { 478 493 list($stdout) = $this->getRepository()->execxLocalCommand( 479 494 'log --format=%s %s',