2

I have a cvs repo with a .git folder. I ran find . -type d \! -name CVS -exec cvs add '{}' \;. Since I have .git in my cvsignore, I assumed it wouldn't add the .git folder. I haven't committed (cvs) yet. What are the consequences of this action? How do I undo the cvs add?

Fwiw, I have to commit this project to cvs and git for work. I realise this sounds like a really stupid procedure, but that's the requirement.

djeikyb
  • 4,470
  • 3
  • 35
  • 42
  • just wonder, if you are already using git, why on earth would you ever touch cvs? – mvp Sep 21 '13 at 08:49
  • @mvp I'm used to git for my own stuff. For this project at work, I need to commit to cvs (which I'm unfamiliar with) and git. My work is considering switching to git. I'm trying to hack together a script to copy git commits to cvs. – djeikyb Sep 21 '13 at 20:13
  • No negative consequences other than messiness. See this question for options on how to remove the directories from CVS: http://stackoverflow.com/questions/204991/remove-empty-directory-from-cvs – Burhan Ali Sep 22 '13 at 10:25
  • @BurhanAli I'm not convinced this question is a dupe, but maybe because I don't know cvs very well. Did the `cvs add .git` actually modify the remote repository, or just my checked out stuff? – djeikyb Sep 22 '13 at 14:09
  • 1
    You have done a `cvs add` on a directory. Even though you have not done a `commit`, these directories now permanently live in the repository as CVS creates them immediately. Files behave differently - they only get added to the repository on commit. CVS itself does not offer any ability to remove directories once they have been added, hence me pointing you to that question as it provides some workarounds. – Burhan Ali Sep 22 '13 at 16:20
  • @BurhanAli That sounds like a great answer to my question. You should add it as an answer! – djeikyb Sep 22 '13 at 19:35

1 Answers1

1

You have carried out a cvs add on a directory. Even though you have not done a cvs commit yet, these directories now permanently live in the repository as CVS creates them immediately. Files behave differently - they only get added to the repository on commit.

CVS itself does not offer any ability to remove directories once they have been added. Unless you add and commit the files in the git directory, there will be no further negative consequences to your repository.

There may be confusion/annoyance though as you will always be shown the contents of your .git directory as "new" files (unless you do update -P - prune empty directories from working copy). Also anyone checking out the module from CVS will get the empty .git directories and may be confused by them.

If any of that sounds like a problem, the following question has some workarounds:

Remove empty directory from CVS?

Community
  • 1
  • 1
Burhan Ali
  • 2,258
  • 1
  • 28
  • 38