{"thread":{"id":"25876","subject":"How to get rid of doubled branch after renaming a branch in svn-repository","startedAt":"2010-12-01T12:48:09Z","lastAt":"2010-12-01T15:08:12Z","messageCount":3,"participants":["pacco@tropezien.de","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"156914","messageId":"0a6b49e3cc0b08a717c0d6141073f32d@tropezien.de","threadId":"25876","inReplyTo":null,"subject":"How to get rid of doubled branch after renaming a branch in svn-repository","fromName":"","fromEmail":"pacco@tropezien.de","sentAt":"2010-12-01T12:48:09Z","receivedAt":"2010-12-01T12:48:09Z","isPatch":false,"sender":{"key":"pacco@tropezien.de","avatar":null},"body":" Hi,\n\n I'm using git-svn as a tracking-tool for a Subversion repository.\n I currently detected an unexpected branch, seeming dead, but visible \n using 'git branch -a'. I checked the svn log and saw that someone has \n moved/renamed a branch. That results in a deletion of the old branch and \n an adding of a copy of the old branch with the new branch name.\n\n The scenario is like that:\n\n $ git branch -a\n * master\n   remotes/svnrepos/git-svn-test\n\n # Rename the branch (move) in the SVN-repos\n $ svn mv https://svn.repos/branches/git-svn-test \n https://svn.repos/branches/git-svn-test-new\n\n # Update git-repository\n $ git svn fetch\n\n $ git branch -a\n * master\n   remotes/svnrepos/git-svn-test\n   remotes/svnrepos/git-svn-test-new\n\n You see the problem. Within Subversion simply a new repository version \n now no longer \"showing\" the git-svn-test-branch was created. But within \n git both branches stay visible.\n Well, I know that renaming a branch is really not that favoured action.\n But I expected that git-svn gathers also this deletion and removes the \n obsolete branch.\n\n So, am I doing something wrong? Or am I expecting the wrong behaviour? \n Or is that simply a feature, not a bug, and must be handled manually?\n"},{"id":"156928","messageId":"4CF6553C.70500@drmicha.warpmail.net","threadId":"25876","inReplyTo":"0a6b49e3cc0b08a717c0d6141073f32d@tropezien.de","subject":"Re: How to get rid of doubled branch after renaming a branch in svn-repository","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-12-01T14:01:32Z","receivedAt":"2010-12-01T14:01:32Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"pacco@tropezien.de venit, vidit, dixit 01.12.2010 13:48:\n>  Hi,\n> \n>  I'm using git-svn as a tracking-tool for a Subversion repository.\n>  I currently detected an unexpected branch, seeming dead, but visible \n>  using 'git branch -a'. I checked the svn log and saw that someone has \n>  moved/renamed a branch. That results in a deletion of the old branch and \n>  an adding of a copy of the old branch with the new branch name.\n> \n>  The scenario is like that:\n> \n>  $ git branch -a\n>  * master\n>    remotes/svnrepos/git-svn-test\n> \n>  # Rename the branch (move) in the SVN-repos\n>  $ svn mv https://svn.repos/branches/git-svn-test \n>  https://svn.repos/branches/git-svn-test-new\n> \n>  # Update git-repository\n>  $ git svn fetch\n> \n>  $ git branch -a\n>  * master\n>    remotes/svnrepos/git-svn-test\n>    remotes/svnrepos/git-svn-test-new\n> \n>  You see the problem. Within Subversion simply a new repository version \n>  now no longer \"showing\" the git-svn-test-branch was created. But within \n>  git both branches stay visible.\n>  Well, I know that renaming a branch is really not that favoured action.\n>  But I expected that git-svn gathers also this deletion and removes the \n>  obsolete branch.\n> \n>  So, am I doing something wrong? Or am I expecting the wrong behaviour? \n>  Or is that simply a feature, not a bug, and must be handled manually?\n> \n\nBranches in svn and git are different. If you delete a branch in svn,\nthe \"content\" is still there in the sense that it is there in previous\nrevisions. You only delete a pointer in your svn-filesystem.\n\nIn git, a branch points at a commit, and deleting a branch means making\nthat commit pointerless (unless it is pointed to by other branches or\ntags). So far there's some similarity. But now, if that commit and all\nits descendants are \"pointerless\" (can't be reached from a named ref)\ngit will garbage collect them after a while. They're considered pointless ;)\n\nsvn records the rename as a copy+delete (it also sets some rename info\nwhich git-svn seems to ignore). So, git-svn stays on the safe side by\nkeeping the branch. Note that deleting the branch would possibly delete\nat least some info since the branch name is not recorded in the commit\n(if you use svn.noMetadata).\n\nYou can safely delete the branch if you're sure its head commit is\ncontained in some other branch (as will be for an ordinary rename).\n\nMichael\n"},{"id":"156938","messageId":"35e60ee2f6d83801d130d53a56a8ae18@tropezien.de","threadId":"25876","inReplyTo":"4CF6553C.70500@drmicha.warpmail.net","subject":"Re: How to get rid of doubled branch after renaming a branch in svn-repository","fromName":"","fromEmail":"pacco@tropezien.de","sentAt":"2010-12-01T15:08:12Z","receivedAt":"2010-12-01T15:08:12Z","isPatch":false,"sender":{"key":"pacco@tropezien.de","avatar":null},"body":" Hi Michael,\n\n On Wed, 01 Dec 2010 15:01:32 +0100, Michael J Gruber \n <git@drmicha.warpmail.net> wrote:\n [snipped]\n> svn records the rename as a copy+delete (it also sets some rename \n> info\n> which git-svn seems to ignore). So, git-svn stays on the safe side by\n> keeping the branch. Note that deleting the branch would possibly \n> delete\n> at least some info since the branch name is not recorded in the \n> commit\n> (if you use svn.noMetadata).\n>\n> You can safely delete the branch if you're sure its head commit is\n> contained in some other branch (as will be for an ordinary rename).\n\n thank you for your explanation. I suspected that this issue might be a \n mixture of different VCS-philosophy and uncertainty-handling.\n Okay, then I will delete the branch manually. Of course I would have \n preferred to have an automatic solution, because I got attention on this \n renaming by accident. I hope renaming a branch will not become a new \n trend in repository actions.\n\n pacco\n"}]}