{"thread":{"id":"13839","subject":"[RFC] git diff dira dirb file ...","startedAt":"2008-06-06T22:27:23Z","lastAt":"2008-06-07T00:40:18Z","messageCount":3,"participants":["Daniel Barkalow","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"78966","messageId":"alpine.LNX.1.00.0806061821320.19665@iabervon.org","threadId":"13839","inReplyTo":null,"subject":"[RFC] git diff dira dirb file ...","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-06-06T22:27:23Z","receivedAt":"2008-06-06T22:27:23Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"After a lot of trying, I finally found something that git diff doesn't \nhandle. If you've got two trees of files with the same general structure, \neven if they aren't at all git-related, you can use:\n\n$ git diff dira dirb\n\nto get a nice diff between them. But then it would be intuitive and useful \nto be able to restrict by path the files within those directories that you \nwant to compare (much like \"git diff origin master file1 file2 ...\") with:\n\n$ git diff dira dirb file1 file2\n\nThat would, of course, compare dira/file1 with dirb/file1 and dira/file2 \nwith dirb/file2. Before I start looking into implementing this, is it \nincoherent for some reason I'm not seeing?\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"78988","messageId":"7vmylyqfga.fsf@gitster.siamese.dyndns.org","threadId":"13839","inReplyTo":"alpine.LNX.1.00.0806061821320.19665@iabervon.org","subject":"Re: [RFC] git diff dira dirb file ...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-07T00:03:17Z","receivedAt":"2008-06-07T00:03:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> After a lot of trying, I finally found something that git diff doesn't \n> handle. If you've got two trees of files with the same general structure, \n> even if they aren't at all git-related, you can use:\n>\n> $ git diff dira dirb\n>\n> to get a nice diff between them. But then it would be intuitive and useful \n> to be able to restrict by path the files within those directories that you \n> want to compare (much like \"git diff origin master file1 file2 ...\") with:\n>\n> $ git diff dira dirb file1 file2\n>\n> That would, of course, compare dira/file1 with dirb/file1 and dira/file2 \n> with dirb/file2. Before I start looking into implementing this, is it \n> incoherent for some reason I'm not seeing?\n\nIncoherent?\n\nI do not see anything fundamentally wrong with it, except that command\nline parsing may get tricky, because we rely on the revision command line\nparser, and logically you should be able to spell the above commandline as\n\"diff dira dirb -- file1 file2\", revision parser wants anything that comes\nbefore -- to be revisions, not paths.\n\nJust make sure that you got two directories, at least one of which is\noutside the work tree, mark your diff option as \"no-index\", then walk the\ntwo directories in parallel to populate the diff_queue().  Once you are\ndone walking, let diffcore_std() to do its usual thing.\n\nHaving said that, that new \"feature\" is not git anymore, and I'd rather\nwish to see competent git people to be working on hunting for and fixing\noutstanding bugs during the -rc period, than spending their time on new\nfeatures and non-git hacking, but all of us do this as hobbies, so I\nwouldn't stop you ;-)\n"},{"id":"78998","messageId":"alpine.LNX.1.00.0806062024440.19665@iabervon.org","threadId":"13839","inReplyTo":"7vmylyqfga.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC] git diff dira dirb file ...","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-06-07T00:40:18Z","receivedAt":"2008-06-07T00:40:18Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 6 Jun 2008, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > After a lot of trying, I finally found something that git diff doesn't \n> > handle. If you've got two trees of files with the same general structure, \n> > even if they aren't at all git-related, you can use:\n> >\n> > $ git diff dira dirb\n> >\n> > to get a nice diff between them. But then it would be intuitive and useful \n> > to be able to restrict by path the files within those directories that you \n> > want to compare (much like \"git diff origin master file1 file2 ...\") with:\n> >\n> > $ git diff dira dirb file1 file2\n> >\n> > That would, of course, compare dira/file1 with dirb/file1 and dira/file2 \n> > with dirb/file2. Before I start looking into implementing this, is it \n> > incoherent for some reason I'm not seeing?\n> \n> Incoherent?\n> \n> I do not see anything fundamentally wrong with it, except that command\n> line parsing may get tricky, because we rely on the revision command line\n> parser, and logically you should be able to spell the above commandline as\n> \"diff dira dirb -- file1 file2\", revision parser wants anything that comes\n> before -- to be revisions, not paths.\n> \n> Just make sure that you got two directories, at least one of which is\n> outside the work tree, mark your diff option as \"no-index\", then walk the\n> two directories in parallel to populate the diff_queue().  Once you are\n> done walking, let diffcore_std() to do its usual thing.\n> \n> Having said that, that new \"feature\" is not git anymore, and I'd rather\n> wish to see competent git people to be working on hunting for and fixing\n> outstanding bugs during the -rc period, than spending their time on new\n> features and non-git hacking, but all of us do this as hobbies, so I\n> wouldn't stop you ;-)\n\nActually, that came up in my day job, where I only really get to use git \nto work around the fact that the big commerical version control system \ndoesn't make it easy to do stuff. So think of it as testing corner cases \nof the diff machinary on the side, when I can't justify working directly \non git.\n\nIn any case, this goes on my list of things to work on someday.\n\nDo you have a list of outstanding issues for the release?\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}