{"thread":{"id":"13546","subject":"git-svn, merging et al.","startedAt":"2008-05-16T15:50:07Z","lastAt":"2008-05-19T09:14:44Z","messageCount":3,"participants":["Nigel Magnay","Kevin Ballard"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77147","messageId":"320075ff0805160850r473582d9qc33f71ba7f56dd51@mail.gmail.com","threadId":"13546","inReplyTo":null,"subject":"git-svn, merging et al.","fromName":"Nigel Magnay","fromEmail":"nigel.magnay@gmail.com","sentAt":"2008-05-16T15:50:07Z","receivedAt":"2008-05-16T15:50:07Z","isPatch":false,"sender":{"key":"nigel.magnay@gmail.com","avatar":"https://gravatar.com/avatar/d85cf38287bef3a8e4fa02358d2756d7589f8676c5eeb881ce2f6d731e4526c3?d=mp&s=160"},"body":"Ok - it's Friday and I've got to interact with svn again..\n\nI'm using git-svn, and I've not followed the guidance. Development has\ngone on in git branches and merges - but now I need to commit the\nchanges back into svn, and dcommit is, understandably, not very happy.\n\nI'm intending to instead do something like a\n  git format-patch svn-branch..git-branch\n  git checkout svn-branch\n... apply all the patches ...\n  git commit\n  git svn dcommit\n  # back to the git work\n  git checkout git-branch\n  # this shouldn't have to do merging - but it will have the parents\nto make it clear where the last merge happened from ?\n  git merge svn-branch\n\n\nI'm happy that I'm bludgeoning changes in one big blob into SVN, as I\ncan reasonably say 'if you want the real details, go look at gitweb)\n\nI've tried doing this with\n git checkout svn-branch\n git merge --squash git-branch\n\nBut I don't get the result I'm expecting - what have I missed?\n"},{"id":"77151","messageId":"05A51125-339A-45A2-B2CF-8035F2FAE741@sb.org","threadId":"13546","inReplyTo":"320075ff0805160850r473582d9qc33f71ba7f56dd51@mail.gmail.com","subject":"Re: git-svn, merging et al.","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-05-16T17:40:28Z","receivedAt":"2008-05-16T17:40:28Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On May 16, 2008, at 11:50 AM, Nigel Magnay wrote:\n\n> Ok - it's Friday and I've got to interact with svn again..\n>\n> I'm using git-svn, and I've not followed the guidance. Development has\n> gone on in git branches and merges - but now I need to commit the\n> changes back into svn, and dcommit is, understandably, not very happy.\n>\n> I'm intending to instead do something like a\n>  git format-patch svn-branch..git-branch\n>  git checkout svn-branch\n> ... apply all the patches ...\n>  git commit\n>  git svn dcommit\n>  # back to the git work\n>  git checkout git-branch\n>  # this shouldn't have to do merging - but it will have the parents\n> to make it clear where the last merge happened from ?\n>  git merge svn-branch\n>\n>\n> I'm happy that I'm bludgeoning changes in one big blob into SVN, as I\n> can reasonably say 'if you want the real details, go look at gitweb)\n>\n> I've tried doing this with\n> git checkout svn-branch\n> git merge --squash git-branch\n>\n> But I don't get the result I'm expecting - what have I missed?\n\nThat merge command will produce a single commit, which isn't what you  \nwant. format-patch + am should work to linearize history, but you  \ncould also use rebase.\n\nI recommend trying something like\n\n   git checkout -b test svn-branch && git format-patch svn-branch..git- \nbranch | git am\n\nThen you can examine your test branch to make sure it's linear, make  \nsure it compiles and looks good, then if it's good merge that into svn- \nbranch (which will be a fast-forward).\n\n-Kevin Ballard\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"77262","messageId":"320075ff0805190214m48a5ceecg8fd19f27a2d98f6@mail.gmail.com","threadId":"13546","inReplyTo":"05A51125-339A-45A2-B2CF-8035F2FAE741@sb.org","subject":"Re: git-svn, merging et al.","fromName":"Nigel Magnay","fromEmail":"nigel.magnay@gmail.com","sentAt":"2008-05-19T09:14:44Z","receivedAt":"2008-05-19T09:14:44Z","isPatch":false,"sender":{"key":"nigel.magnay@gmail.com","avatar":"https://gravatar.com/avatar/d85cf38287bef3a8e4fa02358d2756d7589f8676c5eeb881ce2f6d731e4526c3?d=mp&s=160"},"body":"Ah - useful - I'll tag that for next time.\n\nI ended up doing a git merge --squash in the end. FWIW, it didn't work\ncorrectly initially, until I worked out that some files were getting\nmunged by core.autocrlf confusing it. Once I turned it off, it was\nfine.\n\n\nOn Fri, May 16, 2008 at 6:40 PM, Kevin Ballard <kevin@sb.org> wrote:\n> On May 16, 2008, at 11:50 AM, Nigel Magnay wrote:\n>\n>> Ok - it's Friday and I've got to interact with svn again..\n>>\n>> I'm using git-svn, and I've not followed the guidance. Development has\n>> gone on in git branches and merges - but now I need to commit the\n>> changes back into svn, and dcommit is, understandably, not very happy.\n>>\n>> I'm intending to instead do something like a\n>>  git format-patch svn-branch..git-branch\n>>  git checkout svn-branch\n>> ... apply all the patches ...\n>>  git commit\n>>  git svn dcommit\n>>  # back to the git work\n>>  git checkout git-branch\n>>  # this shouldn't have to do merging - but it will have the parents\n>> to make it clear where the last merge happened from ?\n>>  git merge svn-branch\n>>\n>>\n>> I'm happy that I'm bludgeoning changes in one big blob into SVN, as I\n>> can reasonably say 'if you want the real details, go look at gitweb)\n>>\n>> I've tried doing this with\n>> git checkout svn-branch\n>> git merge --squash git-branch\n>>\n>> But I don't get the result I'm expecting - what have I missed?\n>\n> That merge command will produce a single commit, which isn't what you want.\n> format-patch + am should work to linearize history, but you could also use\n> rebase.\n>\n> I recommend trying something like\n>\n>  git checkout -b test svn-branch && git format-patch svn-branch..git-branch\n> | git am\n>\n> Then you can examine your test branch to make sure it's linear, make sure it\n> compiles and looks good, then if it's good merge that into svn-branch (which\n> will be a fast-forward).\n>\n> -Kevin Ballard\n>\n> --\n> Kevin Ballard\n> http://kevin.sb.org\n> kevin@sb.org\n> http://www.tildesoft.com\n>\n>\n>\n"}]}