Re: cvs2git: some missing features ('Header' expansion, incremental modifications)
Michael Haggerty <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.user |
|---|---|
| Message-ID | <[email protected]> |
On 11/01/2011 08:37 PM, Mojca Miklavec wrote: > I would like to convert some CVS repositories into GIT, but since > those CVS repositories are still upstream, I need to keep the GIT > mirrors up-to-date. I'm currently using "git cvsimport", but it is not > really clear to me how to address some of my requirements either with > that or with cvs2svn. Here is the list of issues: cvs2git does not support incremental conversions. Somebody mentioned having used repeated full conversions to simulate incremental conversions; the overlapping part of the history is often (though not always) identical and so the non-overlapping part can be added to the old repository. But (even if you are not looking for 100% dependability) this approach has the disadvantage that the full conversions, which can take a lot of time, have to be repeated often. "git cvsimport" claims to support incremental conversions but isn't even reliable for one-time conversions. > 1.) Wrong headers > > The files in repository start with something like the following: > > \ProvidesFileRCS $Header: /cvsroot/some/path/file.tex,v 1.8 2010/02/22 > 22:49:21 user Exp $ > > [...] but I wanted to say that with cvs2svn I'm > not even able to figure out how to get those headers. Sadly I end up > with > \ProvidesFileRCS $Header: $ With the trunk version of cvs2git the expansion of keywords can be turned on/off by setting properties on the files (e.g., via the --auto-props mechanism). The property to set is "_keyword_handling" and its effect is described in doc/properties.txt. But please note that this functionality is *not* yet supported with the --use-external-blob-generator option, so you will have to --use-rcs or --use-cvs. (Adding support for this feature (and _eol_fix) to the external blob generator shouldn't be that hard and would be quite useful.) If you don't like the *details* of how keywords are expanded, you can make changes in the class _KeywordExpander in cvs2svn_lib/keyword_expander.py. > 2.) Modifying history > > I need to reshuffle some paths (move files around) and do tiny edits > on files. It is no problem to do that once. Git is very powerful, so > git filter-branch --index-filter ... > and some extra commands do a wonderful job. The problem is that I > would like to keep the GIT mirror up-to-date with original CVS. So I > either need to: > - run a bunch of repository modifications (git filter-branch > --index-filter ... & friends) each time when CVS repository is updated > (this is very inefficient & time expensive) > - write my own script that explores contents of GIT repository which > results from "cvs2svn" or "git cvsimport" and creates a new GIT > repository based on that (very error prone; I will very likely screw > something up) > - looking for proposals for a better approach(?) > > The ideal way to solve the problem would be if I was able to apply > some filter between reading CVS and creating GIT. It would be great if > cvs2svn would parse CVS repository first, then call my script, > providing me access to: > - path to some file > - contents of that file > as well as: > - author of commit > - commit timestamp > and I would be able to change path (filename) & contents with my > script. Then, the script would push the resulting file into GIT. > > Does anyone have a better idea? My explanation was probably not 100% > clear, but I can try to reparaphrase parts if needed. This is not supported. But, given that cvs2git does not support incremental conversion, it may be irrelevant (i.e., you can use "git filter-branch"). There are some changes (e.g., moving files around) that would be easy to do *before* the conversion, by moving the files around in the CVS repository or a copy thereof. > 3.) I would like to rename .cvsignore into .gitignore (and replace > .cvsignore with .gitignore in that file if present). cvs2svn has support for turning .cvsignore files into svn:ignore properties, but not for turning them into .gitignore files. Please note that the syntax and semantics of .gitignore files is different than that of .cvsignore files. For example: * a .gitignore file applies to the directory that it is in and all subdirectories; a .cvsignore file only applies to the directory it is in. So probably you would want to change a .cvsignore entry like "foo.txt" to a .gitignore entry with a leading slash like "/foo.txt". * .cvsignore files supports "!" to clear the list of .cvsignore entries and start again. This is mostly used for clearing... * ...the default entries for .cvsignore files are hard-coded into CVS. .gitignore files have no defaults AFAIK, though defaults could be put in the project's root-level .gitignore file. Given that there is already some special-case code in cvs2svn for .cvsignore files, basic support for converting them to .gitignore files is probably doable. > I'm willing to try to implement some of these features if they are > indeed missing and if they would be useful for more people than just > me, but I would need some pointers where to start. That would be great. I've given you some pointers above, but if you want more information please let me know exactly which feature you want to work on and where you would like help. Michael -- Michael Haggerty [email protected] http://softwareswirl.blogspot.com/ ------------------------------------------------------ http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=2870852 To unsubscribe from this discussion, e-mail: [[email protected]].