{"thread":{"id":"22299","subject":"[question] retrieve some patches from another repository","startedAt":"2010-01-20T05:46:14Z","lastAt":"2010-01-20T08:09:15Z","messageCount":3,"participants":["Crane Cai","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"132165","messageId":"20100120054614.GA1965@crane-desktop","threadId":"22299","inReplyTo":null,"subject":"[question] retrieve some patches from another repository","fromName":"Crane Cai","fromEmail":"crane.cai@amd.com","sentAt":"2010-01-20T05:46:14Z","receivedAt":"2010-01-20T05:46:14Z","isPatch":false,"sender":{"key":"crane.cai@amd.com","avatar":null},"body":"Hi,\n\nSorry to disturb you. I know this mail list is mainly for git development. Till\nnow I have not found some normal user mail list, at last I choose it to ask a\nquestion.\n\nMy target is:\nrepository A - linux upstream:\na->b->c->d->[merge from repository B]->e->f\nrepository B - a maintainer's tree:\nx->y->z->[merge from repository A]->...\nI want to retrieve the patches for one driver and its related\nchanges from commit \"a\" till maintainer's master.\n\nSo I do as this:\n* git checkout repo B's master\n* because maintainer's tree is derived from upstream point \"a\" will be included,\n  use git format-patch repo a source-code-name\n\nThere are 2 issues in it:\n* merge point will cause duplicated patch generated, for example repo B has x,\n  y, z, then accepted by repo A in merge point, and then merge back to repo B\n  (they are different with commit id), they will generate 2 twice.\n* some commits do not only change the driver source code, and they change some\n  other files also. Unfortunately git format-patch cut them. It cause compile\n  error.\n\nMy question:\n  Does some one know git have the ability to do it or do I need to do it\nmanually?\n\n\n-- \nBest Regards,\n- Crane\n"},{"id":"132166","messageId":"7vljft5m7h.fsf@alter.siamese.dyndns.org","threadId":"22299","inReplyTo":"20100120054614.GA1965@crane-desktop","subject":"Re: [question] retrieve some patches from another repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-20T06:23:14Z","receivedAt":"2010-01-20T06:23:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Crane Cai <crane.cai@amd.com> writes:\n\n> * merge point will cause duplicated patch generated, for example repo B has x,\n>   y, z, then accepted by repo A in merge point, and then merge back to repo B\n>   (they are different with commit id), they will generate 2 twice.\n\nThis is inevitable, if 'x' and (say) 'b' corresponds to each other but has\ntextual changes due to different context.\n\n> * some commits do not only change the driver source code, and they change some\n>   other files also. Unfortunately git format-patch cut them. It cause compile\n>   error.\n\nYou are probably running \"format-patch a.. -- path/to/file.c\".  Try giving\nit the --full-diff option as well.  We've recently discussed to make it\nthe default for format-patch but the discussion thread petered out and\ndidn't reach conclusion.\n"},{"id":"132168","messageId":"20100120080915.GB1965@crane-desktop","threadId":"22299","inReplyTo":"7vljft5m7h.fsf@alter.siamese.dyndns.org","subject":"Re: [question] retrieve some patches from another repository","fromName":"Crane Cai","fromEmail":"crane.cai@amd.com","sentAt":"2010-01-20T08:09:15Z","receivedAt":"2010-01-20T08:09:15Z","isPatch":false,"sender":{"key":"crane.cai@amd.com","avatar":null},"body":"Hi Junio,\n\nThank you. It's my pleasure to get git maintainer's response.\n\nOn Tue, Jan 19, 2010 at 10:23:14PM -0800, Junio C Hamano wrote:\n> > * merge point will cause duplicated patch generated, for example repo B has x,\n> >   y, z, then accepted by repo A in merge point, and then merge back to repo B\n> >   (they are different with commit id), they will generate 2 twice.\n> \n> This is inevitable, if 'x' and (say) 'b' corresponds to each other but has\n> textual changes due to different context.\nSo you mean git can not avoid generate 2 twice because they are different\ncommits. If I need this I will manually do it or add a new feature to let\nformat-patch can identify the relationship of the 2 repository, and then move\nthe 'since' point to avoid some point before merge.\nMaybe it has value to do it. Many subsystem maintainers will easy to provide\npatchset from any repository derived from linus to another repository which also\nderived from linus. The patchset will let integration a little easy, you can use\n'git bisect' to trace, git comments to understand the code. And all change list\nis replayed, there almost no issue for integration.\n> \n> \n> You are probably running \"format-patch a.. -- path/to/file.c\".  Try giving\n> it the --full-diff option as well.  We've recently discussed to make it\n> the default for format-patch but the discussion thread petered out and\n> didn't reach conclusion.\nYes, you are right.\n\n-- \nBest Regards,\n- Crane\n"}]}