{"thread":{"id":"17887","subject":"merge smart enough to adapt to renames?","startedAt":"2009-02-19T06:12:58Z","lastAt":"2009-02-22T17:13:49Z","messageCount":10,"participants":["Caleb Cushing","Sitaram Chamarty","Rogan Dawes","Kris Shannon"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105396","messageId":"81bfc67a0902182212h578e677ck6029c56cb86f7bce@mail.gmail.com","threadId":"17887","inReplyTo":null,"subject":"merge smart enough to adapt to renames?","fromName":"Caleb Cushing","fromEmail":"xenoterracide@gmail.com","sentAt":"2009-02-19T06:12:58Z","receivedAt":"2009-02-19T06:12:58Z","isPatch":false,"sender":{"key":"xenoterracide@gmail.com","avatar":"https://gravatar.com/avatar/af3f0745dfa0ea9c4ee551d7d0a3cfe7ba8d229754c11678ab2ed23c3fa57065?d=mp&s=160"},"body":"branch gentoo.org has a file profiles/package.mask\n\nthe software that uses this supports having this be a directory as well.\n\nI'm thinking of mv-ing this file in branch regen2.org to\nprofiles/package.mask/gentoo.org\n\nsince I can't change the location in gentoo.org (for mostly\nnon-technical reasons) when I run git merge gentoo.org from regen2.org\nwill git be smart enough to try to merge an updated\nprofiles/package.mask into profiles/package.mask/gentoo.org in the\nfuture?\n\n-- \nCaleb Cushing\n\nhttp://xenoterracide.blogspot.com\n"},{"id":"105471","messageId":"slrngpqquq.j03.sitaramc@sitaramc.homelinux.net","threadId":"17887","inReplyTo":"81bfc67a0902182212h578e677ck6029c56cb86f7bce@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-02-19T14:25:30Z","receivedAt":"2009-02-19T14:25:30Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-02-19, Caleb Cushing <xenoterracide@gmail.com> wrote:\n> branch gentoo.org has a file profiles/package.mask\n>\n> the software that uses this supports having this be a directory as well.\n>\n> I'm thinking of mv-ing this file in branch regen2.org to\n> profiles/package.mask/gentoo.org\n>\n> since I can't change the location in gentoo.org (for mostly\n> non-technical reasons) when I run git merge gentoo.org from regen2.org\n> will git be smart enough to try to merge an updated\n> profiles/package.mask into profiles/package.mask/gentoo.org in the\n> future?\n\nYes.  I maintain two copies of something (in different\nrepos) like this...\n"},{"id":"105501","messageId":"81bfc67a0902191158x5f0f92d1p7e4af2f9cda50a12@mail.gmail.com","threadId":"17887","inReplyTo":"slrngpqquq.j03.sitaramc@sitaramc.homelinux.net","subject":"Re: merge smart enough to adapt to renames?","fromName":"Caleb Cushing","fromEmail":"xenoterracide@gmail.com","sentAt":"2009-02-19T19:58:52Z","receivedAt":"2009-02-19T19:58:52Z","isPatch":false,"sender":{"key":"xenoterracide@gmail.com","avatar":"https://gravatar.com/avatar/af3f0745dfa0ea9c4ee551d7d0a3cfe7ba8d229754c11678ab2ed23c3fa57065?d=mp&s=160"},"body":"> Yes.  I maintain two copies of something (in different\n> repos) like this...\n\nnice... now the real kicker if I merge from another branch\nsunrise/reviewed and redirect it's package.mask to\npackage.mask/sunrise will git be smart enough to differentiate from\nthe gentoo.org one and the sunrise one? I think even more important is\nhow would I even tell it to do that once I've moved the first one.\n-- \nCaleb Cushing\n\nhttp://xenoterracide.blogspot.com\n"},{"id":"105538","messageId":"slrngprunn.hbo.sitaramc@sitaramc.homelinux.net","threadId":"17887","inReplyTo":"81bfc67a0902191158x5f0f92d1p7e4af2f9cda50a12@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-02-20T00:36:07Z","receivedAt":"2009-02-20T00:36:07Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-02-19, Caleb Cushing <xenoterracide@gmail.com> wrote:\n>> Yes.  I maintain two copies of something (in different\n>> repos) like this...\n>\n> nice... now the real kicker if I merge from another branch\n> sunrise/reviewed and redirect it's package.mask to\n> package.mask/sunrise will git be smart enough to differentiate from\n> the gentoo.org one and the sunrise one? I think even more important is\n> how would I even tell it to do that once I've moved the first one.\n\nNot sure I understood this completely, but I've found it\nhelps to make the rename/move as a separate commit, then\nstart changing stuff.  In other words, do too many things in\nthe same commit, and you could lose this coolness.\n\nThere's some logic somewhere that says \"if we can't find a\nmatch to merge this file, let's see if we ever had the same\nblob as the parent of the file in the MERGE_HEAD and we'll\nuse that as a base to do the merge\".\n"},{"id":"105544","messageId":"81bfc67a0902191817u11361d0bw1f2215a53e284f8f@mail.gmail.com","threadId":"17887","inReplyTo":"slrngprunn.hbo.sitaramc@sitaramc.homelinux.net","subject":"Re: merge smart enough to adapt to renames?","fromName":"Caleb Cushing","fromEmail":"xenoterracide@gmail.com","sentAt":"2009-02-20T02:17:19Z","receivedAt":"2009-02-20T02:17:19Z","isPatch":false,"sender":{"key":"xenoterracide@gmail.com","avatar":"https://gravatar.com/avatar/af3f0745dfa0ea9c4ee551d7d0a3cfe7ba8d229754c11678ab2ed23c3fa57065?d=mp&s=160"},"body":"> Not sure I understood this completely, but I've found it\n> helps to make the rename/move as a separate commit, then\n> start changing stuff.  In other words, do too many things in\n> the same commit, and you could lose this coolness.\n\nwell I the problem is.. in a sense I need to unmerge 2 files that I\nonce merged... they currently have the same name and are in the same\nplace, and where I merge them from they'll continue to have that  name\n(although they are different files with the same purpose) but I want\nthem to have different names and spots in my tree/repo.\n\n-- \nCaleb Cushing\n\nhttp://xenoterracide.blogspot.com\n"},{"id":"105571","messageId":"499E5A9C.6090900@dawes.za.net","threadId":"17887","inReplyTo":"81bfc67a0902191817u11361d0bw1f2215a53e284f8f@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2009-02-20T07:24:12Z","receivedAt":"2009-02-20T07:24:12Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Caleb Cushing wrote:\n>> Not sure I understood this completely, but I've found it\n>> helps to make the rename/move as a separate commit, then\n>> start changing stuff.  In other words, do too many things in\n>> the same commit, and you could lose this coolness.\n> \n> well I the problem is.. in a sense I need to unmerge 2 files that I\n> once merged... they currently have the same name and are in the same\n> place, and where I merge them from they'll continue to have that  name\n> (although they are different files with the same purpose) but I want\n> them to have different names and spots in my tree/repo.\n> \n\nNot having done this myself, I'd take this following suggestion with a\ngrain of salt! :-)\n\nIt seems to me that git is smart enough to figure out where contents get\nmoved to, once. Of course, if you have conflicting moves in the same\nrepo, git's automation falls down. So, if you need to move the \"same\"\nfile in different repositories to different places, you need to do it\nvia an intermediate repo that will be able to \"remember\" which movement\nyou chose.\n\ne.g.\nupstream A:\ndata <- contains one set of data\n\nupstream B:\ndata <- contains another set of data\n\npull upstream A into intermediate A, move the file as desired, and commit:\nIntermediate A:\ndata/upstreamA\n\npull upstream B into intermediate B, move the file as desired, and commit:\nIntermediate B:\ndata/upstreamB\n\nmerge Intermediate A and Intermediate B in master:\nmaster:\ndata/upstreamA\ndata/upstreamB\n\nThen, subsequent pulling from upstream A into Intermediate A will\n\"remember\" the move of \"data\" to \"data/upstreamA\", and similarly with B.\nSubsequent merges of Intermediates A & B into master will end in the\ndesied result.\n\nHope this helps.\n\nRogan\n"},{"id":"105688","messageId":"e51f4f550902202048g9a210f0t8fefaee4d8376f6c@mail.gmail.com","threadId":"17887","inReplyTo":"499E5A9C.6090900@dawes.za.net","subject":"Re: merge smart enough to adapt to renames?","fromName":"Kris Shannon","fromEmail":"kris@shannon.id.au","sentAt":"2009-02-21T04:48:01Z","receivedAt":"2009-02-21T04:48:01Z","isPatch":false,"sender":{"key":"kris@shannon.id.au","avatar":"https://gravatar.com/avatar/13a7c0b3c50ffacf54f456e543023fd702898bb134165fa805f019930524151f?d=mp&s=160"},"body":"Rogan Dawes wrote:\n> It seems to me that git is smart enough to figure out where contents get\n> moved to, once. Of course, if you have conflicting moves in the same\n> repo, git's automation falls down. So, if you need to move the \"same\"\n> file in different repositories to different places, you need to do it\n> via an intermediate repo that will be able to \"remember\" which movement\n> you chose.\n\nYou don't need a whole different repo,  branches are good enough.\n\ngit checkout gentoo-integration\ngit pull gentoo\n\ngit checkout sunrise-integration\ngit pull sunrise\n\ngit checkout master\ngit merge gentoo\ngit merge sunrise\n\nThe integration branches can remember your local changes to\nthe remotes (like the move of packages.mask)\n"},{"id":"105701","messageId":"499FE1A5.9020301@dawes.za.net","threadId":"17887","inReplyTo":"e51f4f550902202048g9a210f0t8fefaee4d8376f6c@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2009-02-21T11:12:37Z","receivedAt":"2009-02-21T11:12:37Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Kris Shannon wrote:\n> Rogan Dawes wrote:\n>> It seems to me that git is smart enough to figure out where contents get\n>> moved to, once. Of course, if you have conflicting moves in the same\n>> repo, git's automation falls down. So, if you need to move the \"same\"\n>> file in different repositories to different places, you need to do it\n>> via an intermediate repo that will be able to \"remember\" which movement\n>> you chose.\n> \n> You don't need a whole different repo,  branches are good enough.\n> \n\nYes, of course.\n\nRogan\n"},{"id":"105750","messageId":"81bfc67a0902211700m7a0d0ae8jd17a871ba102fd9f@mail.gmail.com","threadId":"17887","inReplyTo":"e51f4f550902202048g9a210f0t8fefaee4d8376f6c@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Caleb Cushing","fromEmail":"xenoterracide@gmail.com","sentAt":"2009-02-22T01:00:06Z","receivedAt":"2009-02-22T01:00:06Z","isPatch":false,"sender":{"key":"xenoterracide@gmail.com","avatar":"https://gravatar.com/avatar/af3f0745dfa0ea9c4ee551d7d0a3cfe7ba8d229754c11678ab2ed23c3fa57065?d=mp&s=160"},"body":"On Fri, Feb 20, 2009 at 11:48 PM, Kris Shannon <kris@shannon.id.au> wrote:\n> Rogan Dawes wrote:\n>> It seems to me that git is smart enough to figure out where contents get\n>> moved to, once. Of course, if you have conflicting moves in the same\n>> repo, git's automation falls down. So, if you need to move the \"same\"\n>> file in different repositories to different places, you need to do it\n>> via an intermediate repo that will be able to \"remember\" which movement\n>> you chose.\n>\n> You don't need a whole different repo,  branches are good enough.\n>\n> git checkout gentoo-integration\n> git pull gentoo\n>\n> git checkout sunrise-integration\n> git pull sunrise\n>\n> git checkout master\n> git merge gentoo\n> git merge sunrise\n>\n> The integration branches can remember your local changes to\n> the remotes (like the move of packages.mask)\n>\n\nit sounds like a decent plan on paper... but when you realize each\ncheckout is 100,000+ files...to where as if I create a repo just for\nit... it ends up being like 5 files... and I'm not entirely sure that\nhas much of a negative side effect... other than... yet another\nremote...\n\n-- \nCaleb Cushing\n\nhttp://xenoterracide.blogspot.com\n"},{"id":"105786","messageId":"49A187CD.2020403@dawes.za.net","threadId":"17887","inReplyTo":"81bfc67a0902211700m7a0d0ae8jd17a871ba102fd9f@mail.gmail.com","subject":"Re: merge smart enough to adapt to renames?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2009-02-22T17:13:49Z","receivedAt":"2009-02-22T17:13:49Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Caleb Cushing wrote:\n> On Fri, Feb 20, 2009 at 11:48 PM, Kris Shannon <kris@shannon.id.au> wrote:\n>> Rogan Dawes wrote:\n>>> It seems to me that git is smart enough to figure out where contents get\n>>> moved to, once. Of course, if you have conflicting moves in the same\n>>> repo, git's automation falls down. So, if you need to move the \"same\"\n>>> file in different repositories to different places, you need to do it\n>>> via an intermediate repo that will be able to \"remember\" which movement\n>>> you chose.\n>> You don't need a whole different repo,  branches are good enough.\n>>\n>> git checkout gentoo-integration\n>> git pull gentoo\n>>\n>> git checkout sunrise-integration\n>> git pull sunrise\n>>\n>> git checkout master\n>> git merge gentoo\n>> git merge sunrise\n>>\n>> The integration branches can remember your local changes to\n>> the remotes (like the move of packages.mask)\n>>\n> \n> it sounds like a decent plan on paper... but when you realize each\n> checkout is 100,000+ files...to where as if I create a repo just for\n> it... it ends up being like 5 files... and I'm not entirely sure that\n> has much of a negative side effect... other than... yet another\n> remote...\n> \n\nWell, if you use an \"integration branch\", rather than a whole separate\nrepository, that should simplify things, I think.\n\nAnd, if the differences between the branches are limited to those 5\nfiles, a checkout (if you even really need to check it out) will only\nupdate those files that are different between the branches. It may even\nbe possible to do an \"in index\" merge, without even having a checkout,\nif there are no conflicts.\n\nRogan\n"}]}