From: Junio C Hamano Date: Mon, 29 Aug 2011 21:09:25 GMT Subject: Re: What's the difference between `git show branch:file | diff -u - file` vs `git diff branch file`? Message-ID: <7v62lf6i2i.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vty9054qr.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > Junio C Hamano writes: > >> Of course the merge machinery does not know anything about pruning with >> pathspec, so it is understandable (not justifiable) it would walk the full >> tree. >> >> Will try to find time this week to cook up something. > > This is still rough, but seems to pass the test suite, and gives me some > performance boost when applied to the kernel tree: > > (without patch) > $ time git diff --raw --cached v2.6.30 -- virt/kvm > real 0m0.114s > user 0m0.088s > sys 0m0.028s > > (with patch) > $ time ./git diff --raw --cached v2.6.30 -- virt/kvm > real 0m0.075s > user 0m0.068s > sys 0m0.008s Heh, this is even better without --cached. (without patch) $ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 real 0m0.538s user 0m0.492s sys 0m0.048s (with patch) $ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 real 0m0.038s user 0m0.028s sys 0m0.012s