From: Marco Costalba <mcostalba@yahoo.it>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Check for differents trees
Date: Sun, 6 Nov 2005 11:02:49 -0800 (PST) [thread overview]
Message-ID: <20051106190249.39384.qmail@web26314.mail.ukl.yahoo.com> (raw)
Junio C Hamano wrote:
>>The problem is that if sha1 and sha2 correspond to very
>>"distant" revision the output of git-diff-tree can be very
>>long and also usless as long as I stop searching at first
>>match.
>
>
>Perhaps
>
> $ git-diff-tree -r --name-status --diff-filter=AD sha1 sha2
>
>would help you somewhat? This would not make the diff
>generation part quicker, but at least you do not have to parse
>other types of changes.
>
Thanks Junio,
as you said, the speed is almost the same but your way is clearly better.
I have pushed the change.
P.S.: Could be interesting something like?:
git-diff-tree -r --name-status --diff-filter=^M sha1 sha2
-------------------
>Dscho says:
>
>if you want to know if tree1 and tree2 have *exactly* the same files, you
>only have to compare the sha1 of the two trees. If they are equal you are
>virtually guaranteed that the two trees contain the same files.
I have impemented a tree viewer inside qgit. Tree view is updated when user browses through
revisions.
Loading the file names of a given tree, altough only for the open directories, is an expensive
operation. So I added a little "same files" test to skip tree reloading.
With "same files" I mean that the file list is the same bewteen tree1 and tree1, _not_ that the
files content are the same. As example, if tree1 is parent of tree2 (and tree2 is not a merge) and
the revision between the two only modified files (git-diff-tree status is M), in my test tree1 and
tree2 have the same files, also if sha's are, of course, different.
Put in other way, two trees have the "same files" if I don't have to repaint the tree view window.
Marco
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
next reply other threads:[~2005-11-06 19:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-06 19:02 Marco Costalba [this message]
2005-11-08 17:13 ` Check for differents trees Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2005-11-10 6:57 Marco Costalba
2005-11-10 6:35 Marco Costalba
2005-11-06 15:38 Marco Costalba
2005-11-06 18:09 ` Junio C Hamano
2005-11-06 18:24 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051106190249.39384.qmail@web26314.mail.ukl.yahoo.com \
--to=mcostalba@yahoo.it \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox