Why is deleting a branch in CVS not recommended?
Asked Answered
L

5

26

Under what circumstances would this or would this not be safe? I have a branch that has a four changes (no file add or deletes). Would this be safe to delete?

Edit: The reason for wanting to delete it is that it was misnamed and is going to lead to confusion.

Lactam answered 26/9, 2008 at 18:26 Comment(6)
Wow, some people still use CVS? I thought everyone had migrated either to SVN or to one of the distributed version control systems.Clemente
Yeah, perhaps a better question would be "Why is CVS not recommended?" Let me count the ways...Freedafreedman
We'll be moving soon, but that's not going to solve my problem today :(Lactam
it's so sad to see these already old comments as I trudge through looking for CVS help...Lorrielorrimer
Well... Some... are still on CVS.Najera
yes, in 2018 also in my company CVS is still the most important, and it is much quicker than SVN....Wellbred
B
16

I believe that CVS won't actually delete the branch, it will just remove the tag from the branch -- so the branch is still present in each ",v" file that is affected, it just won't be trivially accessible any more. The result is weird, but probably not dangerous.

Belier answered 26/9, 2008 at 18:32 Comment(1)
This is a really good point. Removing the name of the branch is different from actually removing the branch completely (which requires modifying the repository directly). Other than compulsive neatness, there's porobably no good reason to try to remove a branch from the repository.Blackwood
R
32

People landing here looking for the answer to "How to delete a branch in cvs"

cvs tag -dB branchname

The -d will delete, the -B will override and let it know to delete the branch (not a tag)

Rustice answered 1/9, 2011 at 16:51 Comment(1)
Please let me know how to do the same from eclipse CVS pluginSpindell
B
16

I believe that CVS won't actually delete the branch, it will just remove the tag from the branch -- so the branch is still present in each ",v" file that is affected, it just won't be trivially accessible any more. The result is weird, but probably not dangerous.

Belier answered 26/9, 2008 at 18:32 Comment(1)
This is a really good point. Removing the name of the branch is different from actually removing the branch completely (which requires modifying the repository directly). Other than compulsive neatness, there's porobably no good reason to try to remove a branch from the repository.Blackwood
E
3

Deleting branches is normally not recommended because it loses so much history and cannot be undone. The general recommendation is actually to only remove a branch when it is very young, and when you've made a mistake. Like a typo in the branch name.

Exploitation answered 26/9, 2008 at 18:35 Comment(0)
N
2

If a branch is empty (you didn´t commit anything in it), than it is ok to deleted, it work just like untagging files. But if you already have a commited some files a few times, this would be a little dangerous since you can remove the branch reference, but not the files under it. This would be messy at least.

Instead if really want to "secure" this branch, you could lock the files under(by script is better) so no one could make changes to it anymore and forget about it.

Nattie answered 26/9, 2008 at 18:41 Comment(0)
A
0

Curt is correct, to delete a branch you have to physically run a delete command from the box.

It seems like in the case you mentioned, it would be ok to delete it.

Atonsah answered 26/9, 2008 at 18:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.