{"thread":{"id":"2364","subject":"Check for differents trees","startedAt":"2005-11-06T15:38:30Z","lastAt":"2005-11-06T18:24:04Z","messageCount":3,"participants":["Marco Costalba","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11206","messageId":"20051106153830.18963.qmail@web26312.mail.ukl.yahoo.com","threadId":"2364","inReplyTo":null,"subject":"Check for differents trees","fromName":"Marco Costalba","fromEmail":"mcostalba@yahoo.it","sentAt":"2005-11-06T15:38:30Z","receivedAt":"2005-11-06T15:38:30Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Hi all,\n\n   I need to check as fast as possible if two given trees (sha1 and sha2) have the same files.\n\nWhat I use now is:\n\ngit-diff-tree -r --name-status sha1 sha2\n\nAn then I parse the output for 'A' or 'D' as first char of each line. When I found one of that two\nchars I kwnow trees have different files set.\n\nThe problem is that if sha1 and sha2 correspond to very \"distant\" revision the output of\ngit-diff-tree can be very long and also usless as long as I stop searching at first match.\n\nMy question is if there is a better way, with the constrain of _not_ use a pipe of commands\nlike git-diff-tree....| grep something.\n\nThe constrain belong from Qt process class that is not very friendly with shells.\n\nThanks for any help\nMarco\n \n\n\n\n\n\t\t\n__________________________________ \nYahoo! FareChase: Search multiple travel sites in one click.\nhttp://farechase.yahoo.com\n"},{"id":"11210","messageId":"7vy841y7fl.fsf@assigned-by-dhcp.cox.net","threadId":"2364","inReplyTo":"20051106153830.18963.qmail@web26312.mail.ukl.yahoo.com","subject":"Re: Check for differents trees","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-06T18:09:34Z","receivedAt":"2005-11-06T18:09:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Costalba <mcostalba@yahoo.it> writes:\n\n> What I use now is:\n>\n> git-diff-tree -r --name-status sha1 sha2\n>\n> An then I parse the output for 'A' or 'D' as first char of\n> each line. When I found one of that two chars I kwnow trees\n> have different files set.\n>\n> The problem is that if sha1 and sha2 correspond to very\n> \"distant\" revision the output of git-diff-tree can be very\n> long and also usless as long as I stop searching at first\n> match.\n\nPerhaps\n\n\t$ git-diff-tree -r --name-status --diff-filter=AD sha1 sha2\n\nwould help you somewhat?  This would not make the diff\ngeneration part quicker, but at least you do not have to parse\nother types of changes.\n"},{"id":"11211","messageId":"Pine.LNX.4.63.0511061922570.12750@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2364","inReplyTo":"20051106153830.18963.qmail@web26312.mail.ukl.yahoo.com","subject":"Re: Check for differents trees","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-06T18:24:04Z","receivedAt":"2005-11-06T18:24:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nif you want to know if tree1 and tree2 have *exactly* the same files, you \nonly have to compare the sha1 of the two trees. If they are equal you are \nvirtually guaranteed that the two trees contain the same files.\n\nHth,\nDscho\n"}]}