Re: git diff timing oddity
On Thu, May 06, 2010 at 01:04:18AM -0400, Jay Soffian wrote:
Show 22 quoted lines
> git version 1.7.1, Mac OS X 10.6.3, largish repo (42K files, 35K
> commits, well packed ~ 1GB). Difference between origin and HEAD is a
> single commit.
>
> $ time git diff --stat origin >/dev/null
>
> real 0m0.942s
> user 0m0.713s
> sys 0m0.223s
>
> [...]
>
> $ time git diff --stat origin HEAD >/dev/null
>
> real 0m0.022s
> user 0m0.006s
> sys 0m0.012s
>
> [...]
>
> These should be identical commands, so why is the "origin HEAD" form
> running an order of magnitude faster?
Isn't "git diff --stat origin" comparing against the working tree?
-Peff