1

I successfully converted and imported into git an eight-year old CVS master tree which contains individual CVS projects. I am trying to figure out what the cvs2git conversion did to the individual CVS repositories.

Fortunately, I still have the master CVS tree and have not deployed anything, so I can do this again. I'm looking for git commands that will let me explore what I converted, so I can tell if I should have converted each CVS repository separately.

octopusgrabbus
  • 10,555
  • 15
  • 68
  • 131
  • Are they just subdirectories in the master tree? Try `git log -- ` to get a full history of commits on that directory. – Christopher Aug 20 '12 at 20:04
  • They are sub-directories that themselves are CVS projects. I'll try your command, but that's worthy of an answer. – octopusgrabbus Aug 20 '12 at 20:12
  • Completely agree; was just thinking that you're in a unique position to find out exactly what it does. If that command returns valid and complete history, then it merged the sub-projects into the root repository. If it returns partial or no history, it did something else entirely. – Christopher Aug 20 '12 at 20:34
  • @Christopher Thanks for the git log command. cvs2git appears to have glommed everything together in one git repository. Given I'm the only user, I'll probably stick with CVS at least for now. – octopusgrabbus Aug 21 '12 at 12:51
  • That's a pretty easy thing to fix, and git has great submodule/subtree support. If you ever want to try it, post a comment here and I'll be happy to help. You might even discover there isn't a need for nested repositories, as branch and merge operations in git are comparatively so much faster than CVS. – Christopher Aug 21 '12 at 12:55
  • I'll post a question, and then you can answer it. Actually, IMHO, your git log should be an answer here as well. – octopusgrabbus Aug 21 '12 at 13:50

2 Answers2

2

You can verify what cvs2git did by issuing git log against one of your subprojects:

git log -- <directory>

If that command returns a full history, cvs2git merged all your subprojects into one. Based on your comments this looks to be the case.

You've now got a choice: Fracture the repo or keep it combined? This isn't always a clear-cut decision, and the motivations for fracturing a repo in CVS are different than they are in git.

I recommend trying your new git repository for a couple of weeks, without fracturing it into submodules, subtrees, or nested repositories. This will get you comfortable with common git commands, and let you try out some great git features like git bisect, which are more difficult to use when you nest projects. Additionally, I suspect you'll find branching and particularly merging to be stupidly easy in comparison to CVS. It might be the case that you don't need to fracture the repository at all.

If you decide you want to do so, give some other answers on the topic a read. Splitting the repo itself is easy. Here's a simple tutorial from github. A quick google search will turn up quite a few more.

Community
  • 1
  • 1
Christopher
  • 42,720
  • 11
  • 81
  • 99
  • My problem though is as follows: if I have CVS directories in /home/ics/bin and /home/ics/icsdev and those are two separate CVS projects, how do I identify the icsdev files from the bin files, if everything's in one git repository? BTW I did create a more specific post for this question, and I will read the tutorial. Thanks. – octopusgrabbus Aug 21 '12 at 14:43
  • Hmmmm... so the projects are basically forks of one another? – Christopher Aug 21 '12 at 14:46
  • Each directory represents a separate CVS project. /home/ics/icsdev and /home/icsprod/ share the same CVS repository, where icsdev is development and icsprod is production. /home/ics/bin is separate from those, as is /home/ics/notes. – octopusgrabbus Aug 21 '12 at 15:15
  • It's interesting. Once I set the repository for remote access, and used remote add and clone, all the project directories showed up. I'm glad I took your advice and did not rush with this. – octopusgrabbus Aug 21 '12 at 15:38
1

I just converted an eight years old CVS repository using cvs2git. I found that using "gitk --all" in the resulting repositories let me have a good grasp as to how the convertion did. So, I'd suggest this command to you.

However, I didn't convert the whole CVS repo into a single Git repo. As your, my CVS repo had, in fact, several different projects inside it. Each project was inside a different directory. So, I performed several conversions, one for each project. You simply point cvs2git to the particular subdirectory of the CVS repo that you are interested in. It will convert the directories history into a Git repository. So, I ended up with several Git repos, one for each project, which gave me much better histories for each repository. I'd suggest you try this approach too.

Gnustavo
  • 370
  • 3
  • 9