All of lore.kernel.org
 help / color / mirror / Atom feed
* What's the difference between `git show branch:file | diff -u - file` vs `git diff branch file`?
@ 2011-08-23  7:25 Marat Radchenko
  2011-08-23 10:03 ` Michael J Gruber
  2011-08-29  7:41 ` Nguyen Thai Ngoc Duy
  0 siblings, 2 replies; 56+ messages in thread
From: Marat Radchenko @ 2011-08-23  7:25 UTC (permalink / raw)
  To: git

$ time git show branch:file | diff -u - file > /dev/null 

real    0m0.003s
user    0m0.000s
sys     0m0.000s

$ time git diff branch -- file > /dev/null 

real    0m31.442s
user    0m31.040s
sys     0m0.380s

What does git diff do so it takes that much time? And is there any flag to git 
diff so that it will work as fast as show + diff? I thought these two are 
equivalent but from run time it is obvious that they aren't.

gprof output: http://slonopotamus.org/git-diff/git-diff-branch.gprof.txt

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2012-01-18  9:00 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23  7:25 What's the difference between `git show branch:file | diff -u - file` vs `git diff branch file`? Marat Radchenko
2011-08-23 10:03 ` Michael J Gruber
2011-08-23 10:52   ` Marat Radchenko
2011-08-23 15:20     ` Michael Witten
2011-08-23 15:34     ` Michael J Gruber
2011-08-23 16:45       ` Marat Radchenko
2011-08-23 17:15       ` Junio C Hamano
2011-08-23 18:21         ` Marat Radchenko
2011-08-23 20:07         ` Michael J Gruber
2011-08-25 16:09           ` Marat Radchenko
2011-08-25 21:10           ` Junio C Hamano
2011-08-26  9:43             ` Marat Radchenko
2011-08-29  7:41 ` Nguyen Thai Ngoc Duy
2011-08-29 14:48   ` Marat Radchenko
2011-08-29 16:09     ` Nguyen Thai Ngoc Duy
2011-08-29 17:18       ` Junio C Hamano
2011-08-29 20:42         ` Junio C Hamano
2011-08-29 20:50           ` Junio C Hamano
2011-08-29 21:09           ` Junio C Hamano
2011-08-29 21:33           ` [PATCH 0/3] Un-pessimize "diff-index $commit -- $pathspec" Junio C Hamano
2011-08-29 21:33             ` [PATCH 1/3] traverse_trees(): allow pruning with pathspec Junio C Hamano
2011-08-30 12:53               ` Nguyen Thai Ngoc Duy
2011-08-30 17:44                 ` Junio C Hamano
2011-08-31  1:35                   ` Nguyen Thai Ngoc Duy
2011-10-09 15:39               ` Michael Haggerty
2011-10-09 21:35                 ` Nguyen Thai Ngoc Duy
2011-10-10  4:42                   ` Michael Haggerty
2011-08-29 21:33             ` [PATCH 2/3] unpack-trees: " Junio C Hamano
2011-08-30 13:03               ` Nguyen Thai Ngoc Duy
2011-08-30 17:32                 ` Junio C Hamano
2011-08-30 15:24               ` David Michael Barr
2011-08-29 21:33             ` [PATCH 3/3] diff-index: pass pathspec down to unpack-trees machinery Junio C Hamano
2012-01-11  6:31               ` Jonathan Nieder
2012-01-11  8:05                 ` Junio C Hamano
2012-01-11 12:33                 ` Nguyen Thai Ngoc Duy
2012-01-11 12:47                   ` Nguyen Thai Ngoc Duy
2012-01-11 20:40                   ` Junio C Hamano
2012-01-12  4:09                 ` [PATCH] tree_entry_interesting: make recursive mode default Nguyễn Thái Ngọc Duy
2012-01-12  5:04                   ` Junio C Hamano
2012-01-12  5:44                     ` Nguyen Thai Ngoc Duy
2012-01-14  9:23                   ` [PATCH v2 1/2] Document limited recursion pathspec matching with wildcards Nguyễn Thái Ngọc Duy
2012-01-14  9:23                     ` [PATCH v2 2/2] tree_entry_interesting: make recursive mode default Nguyễn Thái Ngọc Duy
2012-01-15  3:12                       ` Junio C Hamano
2012-01-15 10:03                         ` Nguyen Thai Ngoc Duy
2012-01-16 22:15                           ` Junio C Hamano
2012-01-18  8:59                             ` Nguyen Thai Ngoc Duy
2012-01-15  2:38                     ` [PATCH v2 1/2] Document limited recursion pathspec matching with wildcards Junio C Hamano
2012-01-15  9:48                       ` Nguyen Thai Ngoc Duy
2011-08-29 21:56             ` [PATCH 0/3] Un-pessimize "diff-index $commit -- $pathspec" Linus Torvalds
2011-08-29 22:05               ` Junio C Hamano
2011-08-29 22:11                 ` Linus Torvalds
2011-08-29 23:42                   ` Junio C Hamano
2011-08-30  6:16                     ` Marat Radchenko
2011-08-31  0:18                       ` Junio C Hamano
2011-08-30 10:04             ` Michael J Gruber
2011-08-30 17:03               ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.