Re: Check for differents trees
From: Marco Costalba <hidden>
Date: 2016-06-15 22:42:11
Junio C Hamano wrote:
Marco Costalba [off-list ref] writes:quoted
as you said, the speed is almost the same but your way is clearly better.How often do you do this --diff-filter=AD and why? If it is a common enough operation, we could add a specific hack to stop feeding the diff machinery with unwanted kind of changes when diff-filter is set and none of -B/-C/-M are used. That _might_ speed things up for you.
Sorry for late answer but I was off line a few days.
QGit has a tree viewer now. Tree view is updated when user browses through revisions. Loading the
file names of a given tree, although only for the open directories, is an expensive operation. So
qgit checks for different files anytime the user selects a new revision and the tree viewer is
open, I use this test to skip tree reloading if trees have the same files.
I have made some speed test on Linux tree with
git-diff-tree -r --name-status --diff-filter=AD sha1 sha2
On my box it takes from 50-100ms for near revisions to almost 2 seconds when you select a new
revision very far from current one. Add to this the fact that in distant revs case there is a high
probability that the trees are found different, so you need also to reload the tree at the end,
adding extra time before GUI update.
So definitely, It will be great to keep tree browsing snappy. I speak for qgit, but I think any
git viewer that adds tree browsing feature should benefit from this change.
Marco
P.S: By the way, if I understand correctly, what you propone is a different behavior of
--diff-filter=AD. Not to filter for AD, but to find first match of AD. Because of this, IMHO
should be better to have a --first-match=AD flag or, better idea, to use --max-count option (from
git-rev-list) togheter with --diff-filter and have something like:
git-diff-tree -r --name-status --diff-filter=AD --max-count=1 sha1 sha2
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com