Skip to content

Commit 9329e6a

Browse files
author
epriestley
committed
Stop doing an excessive amount of work in diffusion.rawdiffquery
Ref T11665. Without `-n 1`, this logs the ENTIRE history of the repository. We actually get the right result, but this is egregiously slow. Add `-n 1` to return only one result. It appears that I wrote this wrong way back in 2011, in D953. This query is rarely used (until recently) which is likely why it has escaped notice for so long. Test Plan: Used Conduit console to execute `diffusion.rawdiffquery`. Got the same results but spent 8ms instead of 200ms executing this command, in a very small repository.
1 parent 03d323e commit 9329e6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function newQueryFuture() {
2323
// Check if this is the root commit by seeing if it has parents, since
2424
// `git diff X^ X` does not work if "X" is the initial commit.
2525
list($parents) = $repository->execxLocalCommand(
26-
'log --format=%s %s --',
26+
'log -n 1 --format=%s %s --',
2727
'%P',
2828
$commit);
2929

0 commit comments

Comments
 (0)