From: Junio C Hamano Date: Mon, 11 Apr 2011 18:14:57 GMT Subject: Re: [PATCHv2 2/3] --dirstat-by-file: Make it faster and more correct Message-ID: <7vwrj0wt7i.fsf@alter.siamese.dyndns.org> In-Reply-To: <1302475732-741-3-git-send-email-johan@herland.net> Johan Herland writes: > Currently, when using --dirstat-by-file, it first does the full --dirstat > analysis (using diffcore_count_changes()), and then resets 'damage' to 1, > if any damage was found by diffcore_count_changes(). > > But --dirstat-by-file is not interested in the file damage per se. It only > cares if the file changed at all. In that sense it only cares if the blob > SHA1 for a file has changed. We therefore only need to compare the SHA1s > of each file pair in the diff queue. As a result, we can skip the entire > --dirstat analysis and simply set 'damage' to 1 for each entry where the > SHA1 has changed. Very sensible. Thanks.