{"thread":{"id":"24340","subject":"git-svn: both merged commits and original commits are showing up in branches after migration","startedAt":"2010-07-09T02:58:53Z","lastAt":"2010-07-12T18:31:44Z","messageCount":5,"participants":["Bradley Wagner","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145182","messageId":"AANLkTikwyFwO2G1E6rozSxrI4g51wyA8CFV5jl30qRo-@mail.gmail.com","threadId":"24340","inReplyTo":null,"subject":"git-svn: both merged commits and original commits are showing up in branches after migration","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-09T02:58:53Z","receivedAt":"2010-07-09T02:58:53Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"I've done a migration using \"git-svn init\" and \"git-svn fetch\". After\nthe migration, I did a \"git log refs/remotes/svn/6.7\" and found that\nit listed both the commits that I merged into the 6.7 branch and the\noriginal commits to the trunk/master even though the SVN history\nobviously only has what was merged into that branch. Any idea why the\nGit branch has both (see below)? I did notice that the merged commits\nseem to have extra metadata in the \"Merge\" property.\n\nResults of \"git log /path/to/6.7\":\n\ncommit 6e18557b8f7e7173d26df7dd1857362c27eb3ab1\nMerge: e36cfba c8a400c\nAuthor: <author>\nDate:   Fri Jun 25 21:00:19 2010 +0000\n\n    PROJ-6648 (Merged from Trunk): Updated the API version in build file\n\n    git-svn-id:\nfile:///Users/Developers/git_transition/svn_repo/6.7@14254\nf4356f54-06d4-464e-91d3-36485834cb4b\n\ncommit c8a400c3ef8ac113dd325382bedd073bfedc3dd1\nAuthor: <author>\nDate:   Fri Jun 25 20:39:33 2010 +0000\n\n    PROJ-6648: Updated the API version in build file\n\n    git-svn-id:\nfile:///Users/Developers/git_transition/svn_repo/trunk@14253\nf4356f54-06d4-464e-91d3-36485834cb4b\n\n\ncommit 9b968ba82f6f850919c41702dc024703e5721b7e\nMerge: <author2>\nAuthor: Mike Strauch <mike.strauch@hannonhill.com>\nDate:   Fri Jun 25 14:45:30 2010 +0000\n\n    PROJ-6819: (Merged from Trunk) Reverted changes from last commit\nwhere initialize and teardown were called on each sftpshuttle\ninvocation.  Now using a strategy where\n\n    git-svn-id:\nfile:///Users/Developers/git_transition/svn_repo/6.7@14251\nf4356f54-06d4-464e-91d3-36485834cb4b\n\n\ncommit c628db12ef8136cdf22749058e8d8682d0021b8b\nAuthor: <author2>\nDate:   Thu Jun 24 20:10:53 2010 +0000\n\n    PROJ-6819: Reverted changes from last commit where initialize and\nteardown were called on each sftpshuttle invocation.  Now using a\nstrategy where the retries counter\n\n    git-svn-id:\nfile:///Users/Developers/git_transition/svn_repo/trunk@14240\nf4356f54-06d4-464e-91d3-36485834cb4b\n"},{"id":"145188","messageId":"AANLkTilm-BGNsAmb2OwP7qsHl3GJmTCxn_2uGM-GJGGd@mail.gmail.com","threadId":"24340","inReplyTo":"AANLkTikwyFwO2G1E6rozSxrI4g51wyA8CFV5jl30qRo-@mail.gmail.com","subject":"Re: git-svn: both merged commits and original commits are showing up in branches after migration","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-09T03:33:18Z","receivedAt":"2010-07-09T03:33:18Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"Note: I could understand how the log could contain commits to the\ntrunk from *before* the branch was made, but not commits to the trunk\nafter the branch was made that were eventually merged into the branch\nin a separate commit.\n\nOn Thu, Jul 8, 2010 at 10:58 PM, Bradley Wagner\n<bradley.wagner@hannonhill.com> wrote:\n> I've done a migration using \"git-svn init\" and \"git-svn fetch\". After\n> the migration, I did a \"git log refs/remotes/svn/6.7\" and found that\n> it listed both the commits that I merged into the 6.7 branch and the\n> original commits to the trunk/master even though the SVN history\n> obviously only has what was merged into that branch. Any idea why the\n> Git branch has both (see below)? I did notice that the merged commits\n> seem to have extra metadata in the \"Merge\" property.\n>\n> Results of \"git log /path/to/6.7\":\n>\n> commit 6e18557b8f7e7173d26df7dd1857362c27eb3ab1\n> Merge: e36cfba c8a400c\n> Author: <author>\n> Date:   Fri Jun 25 21:00:19 2010 +0000\n>\n>    PROJ-6648 (Merged from Trunk): Updated the API version in build file\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/6.7@14254\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n> commit c8a400c3ef8ac113dd325382bedd073bfedc3dd1\n> Author: <author>\n> Date:   Fri Jun 25 20:39:33 2010 +0000\n>\n>    PROJ-6648: Updated the API version in build file\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/trunk@14253\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n>\n> commit 9b968ba82f6f850919c41702dc024703e5721b7e\n> Merge: <author2>\n> Author: Mike Strauch <mike.strauch@hannonhill.com>\n> Date:   Fri Jun 25 14:45:30 2010 +0000\n>\n>    PROJ-6819: (Merged from Trunk) Reverted changes from last commit\n> where initialize and teardown were called on each sftpshuttle\n> invocation.  Now using a strategy where\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/6.7@14251\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n>\n> commit c628db12ef8136cdf22749058e8d8682d0021b8b\n> Author: <author2>\n> Date:   Thu Jun 24 20:10:53 2010 +0000\n>\n>    PROJ-6819: Reverted changes from last commit where initialize and\n> teardown were called on each sftpshuttle invocation.  Now using a\n> strategy where the retries counter\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/trunk@14240\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n"},{"id":"145382","messageId":"AANLkTin3TYuC-y2U-o4NEgXH7N4M59vqWxXsa6J2Ae74@mail.gmail.com","threadId":"24340","inReplyTo":"AANLkTikwyFwO2G1E6rozSxrI4g51wyA8CFV5jl30qRo-@mail.gmail.com","subject":"Re: git-svn: both merged commits and original commits are showing up in branches after migration","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-12T17:34:04Z","receivedAt":"2010-07-12T17:34:04Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"I'm getting ready to switch over to Git entirely and wanted to make\nsure this was expected behavior. It appears to be based on the\npresence of the \"Merge\" property but I'm still not exactly sure why\nthe original commit would show up in the branch history.\n\nI asked the same question on StackOverflow:\nhttp://stackoverflow.com/questions/3229024/git-commits-to-master-branch-showing-up-in-other-branches.\n\nOn Thu, Jul 8, 2010 at 10:58 PM, Bradley Wagner\n<bradley.wagner@hannonhill.com> wrote:\n> I've done a migration using \"git-svn init\" and \"git-svn fetch\". After\n> the migration, I did a \"git log refs/remotes/svn/6.7\" and found that\n> it listed both the commits that I merged into the 6.7 branch and the\n> original commits to the trunk/master even though the SVN history\n> obviously only has what was merged into that branch. Any idea why the\n> Git branch has both (see below)? I did notice that the merged commits\n> seem to have extra metadata in the \"Merge\" property.\n>\n> Results of \"git log /path/to/6.7\":\n>\n> commit 6e18557b8f7e7173d26df7dd1857362c27eb3ab1\n> Merge: e36cfba c8a400c\n> Author: <author>\n> Date:   Fri Jun 25 21:00:19 2010 +0000\n>\n>    PROJ-6648 (Merged from Trunk): Updated the API version in build file\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/6.7@14254\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n> commit c8a400c3ef8ac113dd325382bedd073bfedc3dd1\n> Author: <author>\n> Date:   Fri Jun 25 20:39:33 2010 +0000\n>\n>    PROJ-6648: Updated the API version in build file\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/trunk@14253\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n>\n> commit 9b968ba82f6f850919c41702dc024703e5721b7e\n> Merge: <author2>\n> Author: Mike Strauch <mike.strauch@hannonhill.com>\n> Date:   Fri Jun 25 14:45:30 2010 +0000\n>\n>    PROJ-6819: (Merged from Trunk) Reverted changes from last commit\n> where initialize and teardown were called on each sftpshuttle\n> invocation.  Now using a strategy where\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/6.7@14251\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n>\n> commit c628db12ef8136cdf22749058e8d8682d0021b8b\n> Author: <author2>\n> Date:   Thu Jun 24 20:10:53 2010 +0000\n>\n>    PROJ-6819: Reverted changes from last commit where initialize and\n> teardown were called on each sftpshuttle invocation.  Now using a\n> strategy where the retries counter\n>\n>    git-svn-id:\n> file:///Users/Developers/git_transition/svn_repo/trunk@14240\n> f4356f54-06d4-464e-91d3-36485834cb4b\n>\n\n\n\n-- \nHannon Hill - Put Us to the Test\nbradley.wagner@hannonhill.com | http://www.hannonhill.com\n"},{"id":"145385","messageId":"20100712182421.GA8644@dert.cs.uchicago.edu","threadId":"24340","inReplyTo":"AANLkTin3TYuC-y2U-o4NEgXH7N4M59vqWxXsa6J2Ae74@mail.gmail.com","subject":"Re: git-svn: both merged commits and original commits are showing up in branches after migration","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-12T18:24:21Z","receivedAt":"2010-07-12T18:24:21Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Bradley,\n\nBradley Wagner wrote:\n> On Thu, Jul 8, 2010 at 10:58 PM, Bradley Wagner wrote:\n\n>> I've done a migration using \"git-svn init\" and \"git-svn fetch\". After\n>> the migration, I did a \"git log refs/remotes/svn/6.7\" and found that\n>> it listed both the commits that I merged into the 6.7 branch and the\n>> original commits to the trunk/master even though the SVN history\n>> obviously only has what was merged into that branch.\n\nYes, this is intentional.  If you try ‘gitk --all’, you can see\nthe history of all branches, where they branched from, and so on.\n\nAs far as I know the svn:mergeinfo is not actually used until\na merge.  Instead, git-svn uses subversion’s file copy tracking\ninformation to follow history past a branch point; see the\nfind_parent_branch function in the git-svn script for details.\n\nHope that helps,\nJonathan\n"},{"id":"145387","messageId":"AANLkTikTDv5NI_7oEdfdp4ZHY6No4JKTJU28Sat9wQhk@mail.gmail.com","threadId":"24340","inReplyTo":"20100712182421.GA8644@dert.cs.uchicago.edu","subject":"Re: git-svn: both merged commits and original commits are showing up in branches after migration","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-12T18:31:44Z","receivedAt":"2010-07-12T18:31:44Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"Thanks!\n\nSeemed weird at first that I would see both the original commit and\nthe merge. I'm realizing now that this is the way Git handles merges,\nhowever, so I guess it's just trying to apply the same logic during\nthe svn 2 git migration by utilizing the svn:merge-info to \"re-create\"\nthe branch history.\n\nI noticed that this did not happen in branches created before we\nupgraded to the SVN version that supported merge tracking.\n\nOn Mon, Jul 12, 2010 at 2:24 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi Bradley,\n>\n> Bradley Wagner wrote:\n>> On Thu, Jul 8, 2010 at 10:58 PM, Bradley Wagner wrote:\n>\n>>> I've done a migration using \"git-svn init\" and \"git-svn fetch\". After\n>>> the migration, I did a \"git log refs/remotes/svn/6.7\" and found that\n>>> it listed both the commits that I merged into the 6.7 branch and the\n>>> original commits to the trunk/master even though the SVN history\n>>> obviously only has what was merged into that branch.\n>\n> Yes, this is intentional.  If you try ‘gitk --all’, you can see\n> the history of all branches, where they branched from, and so on.\n>\n> As far as I know the svn:mergeinfo is not actually used until\n> a merge.  Instead, git-svn uses subversion’s file copy tracking\n> information to follow history past a branch point; see the\n> find_parent_branch function in the git-svn script for details.\n>\n> Hope that helps,\n> Jonathan\n>\n"}]}