git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to get rid of doubled branch after renaming a branch in svn-repository
@ 2010-12-01 12:48 pacco
  2010-12-01 14:01 ` Michael J Gruber
  0 siblings, 1 reply; 3+ messages in thread
From: pacco @ 2010-12-01 12:48 UTC (permalink / raw)
  To: git

 Hi,

 I'm using git-svn as a tracking-tool for a Subversion repository.
 I currently detected an unexpected branch, seeming dead, but visible 
 using 'git branch -a'. I checked the svn log and saw that someone has 
 moved/renamed a branch. That results in a deletion of the old branch and 
 an adding of a copy of the old branch with the new branch name.

 The scenario is like that:

 $ git branch -a
 * master
   remotes/svnrepos/git-svn-test

 # Rename the branch (move) in the SVN-repos
 $ svn mv https://svn.repos/branches/git-svn-test 
 https://svn.repos/branches/git-svn-test-new

 # Update git-repository
 $ git svn fetch

 $ git branch -a
 * master
   remotes/svnrepos/git-svn-test
   remotes/svnrepos/git-svn-test-new

 You see the problem. Within Subversion simply a new repository version 
 now no longer "showing" the git-svn-test-branch was created. But within 
 git both branches stay visible.
 Well, I know that renaming a branch is really not that favoured action.
 But I expected that git-svn gathers also this deletion and removes the 
 obsolete branch.

 So, am I doing something wrong? Or am I expecting the wrong behaviour? 
 Or is that simply a feature, not a bug, and must be handled manually?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to get rid of doubled branch after renaming a branch in svn-repository
  2010-12-01 12:48 How to get rid of doubled branch after renaming a branch in svn-repository pacco
@ 2010-12-01 14:01 ` Michael J Gruber
  2010-12-01 15:08   ` pacco
  0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2010-12-01 14:01 UTC (permalink / raw)
  To: pacco; +Cc: git

pacco@tropezien.de venit, vidit, dixit 01.12.2010 13:48:
>  Hi,
> 
>  I'm using git-svn as a tracking-tool for a Subversion repository.
>  I currently detected an unexpected branch, seeming dead, but visible 
>  using 'git branch -a'. I checked the svn log and saw that someone has 
>  moved/renamed a branch. That results in a deletion of the old branch and 
>  an adding of a copy of the old branch with the new branch name.
> 
>  The scenario is like that:
> 
>  $ git branch -a
>  * master
>    remotes/svnrepos/git-svn-test
> 
>  # Rename the branch (move) in the SVN-repos
>  $ svn mv https://svn.repos/branches/git-svn-test 
>  https://svn.repos/branches/git-svn-test-new
> 
>  # Update git-repository
>  $ git svn fetch
> 
>  $ git branch -a
>  * master
>    remotes/svnrepos/git-svn-test
>    remotes/svnrepos/git-svn-test-new
> 
>  You see the problem. Within Subversion simply a new repository version 
>  now no longer "showing" the git-svn-test-branch was created. But within 
>  git both branches stay visible.
>  Well, I know that renaming a branch is really not that favoured action.
>  But I expected that git-svn gathers also this deletion and removes the 
>  obsolete branch.
> 
>  So, am I doing something wrong? Or am I expecting the wrong behaviour? 
>  Or is that simply a feature, not a bug, and must be handled manually?
> 

Branches in svn and git are different. If you delete a branch in svn,
the "content" is still there in the sense that it is there in previous
revisions. You only delete a pointer in your svn-filesystem.

In git, a branch points at a commit, and deleting a branch means making
that commit pointerless (unless it is pointed to by other branches or
tags). So far there's some similarity. But now, if that commit and all
its descendants are "pointerless" (can't be reached from a named ref)
git will garbage collect them after a while. They're considered pointless ;)

svn records the rename as a copy+delete (it also sets some rename info
which git-svn seems to ignore). So, git-svn stays on the safe side by
keeping the branch. Note that deleting the branch would possibly delete
at least some info since the branch name is not recorded in the commit
(if you use svn.noMetadata).

You can safely delete the branch if you're sure its head commit is
contained in some other branch (as will be for an ordinary rename).

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to get rid of doubled branch after renaming a branch in svn-repository
  2010-12-01 14:01 ` Michael J Gruber
@ 2010-12-01 15:08   ` pacco
  0 siblings, 0 replies; 3+ messages in thread
From: pacco @ 2010-12-01 15:08 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git

 Hi Michael,

 On Wed, 01 Dec 2010 15:01:32 +0100, Michael J Gruber 
 <git@drmicha.warpmail.net> wrote:
 [snipped]
> svn records the rename as a copy+delete (it also sets some rename 
> info
> which git-svn seems to ignore). So, git-svn stays on the safe side by
> keeping the branch. Note that deleting the branch would possibly 
> delete
> at least some info since the branch name is not recorded in the 
> commit
> (if you use svn.noMetadata).
>
> You can safely delete the branch if you're sure its head commit is
> contained in some other branch (as will be for an ordinary rename).

 thank you for your explanation. I suspected that this issue might be a 
 mixture of different VCS-philosophy and uncertainty-handling.
 Okay, then I will delete the branch manually. Of course I would have 
 preferred to have an automatic solution, because I got attention on this 
 renaming by accident. I hope renaming a branch will not become a new 
 trend in repository actions.

 pacco

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-01 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-01 12:48 How to get rid of doubled branch after renaming a branch in svn-repository pacco
2010-12-01 14:01 ` Michael J Gruber
2010-12-01 15:08   ` pacco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).