0

I am migrating many repositories from CVS to GIT. I used cvs gitimport first, but it didn't work properly. cvs2git works (almost) fine. Unfortunately there is one issue that worked in cvs gitimport and does not work in cvs2git (and is important for me) After migration using cvs2git, fields containing keywords (in specific files) are empty:


$Header$

$Revision$

$Author$

$Date$

"filename" Revision: 1.2


I tried different configurations of: ctx.revision_collector, ctx.revision_reader,_keyword_handling but the effect is still the same.

The main commands I used:

cvs2git --blobfile=cvs2git-tmp/${module}-tmp/git-blob.dat --dumpfile=cvs2git-tmp/${module}-tmp/git-dump.dat --username=migrationuser --encoding=ascii --encoding=utf8 --encoding=cp1250 --encoding=iso8859_2 --fallback-encoding=ascii --retain-conflicting-attic-files ${module}

git --bare init "projectname" cd "projectname" cat ../../cvs2git-tmp/git-blob.dat ../../cvs2git-tmp/git-dump.dat | git fast-import git branch -D TAG.FIXUP git gc --prune=now git repack -a -d -f

Has anyone managed to solve such a problem? Thank you in advance for your answer

4

1 回答 1

0

我使用我的cvs-fast-exportcvsconvert分支中的程序 (原始版本现在错误地盲目地用于检查修订,但这与 CVS 通常所做的完全不同!)-kb

我的版本目前没有传递任何-k选项,因此主要扩展关键字,因为 CVS 用户希望它们被扩展。

一旦您转换为 Git,如果您想继续使用每个文件的关键字扩展,那么您可以考虑使用 Git 的$Format:$功能,该功能通过export-subst为所有需要此类扩展的文件设置属性来启用,并使用git-archive(1 ) . 请注意,这些仅在使用 创建发行版时才会扩展git archive,但通常那是它们最有用的时候。

例如,我将旧出现的$Id$or替换$CVSHeader$为以下内容(根据需要适应不同的注释或字符串常量语法,当然还有实际的项目名称和文件路径):

#ident  "@(#)PROJECT:FILEPATH:$Format:%D:%ci:%cN:%h$"
于 2020-02-24T22:15:38.643 回答