pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
test git conversion
32+ messages / 5 participants
[nested] [flat]

* test git conversion
@ 2011-10-05 07:42  Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-05 07:42 UTC (permalink / raw)
  To: pgsql-jdbc

So I did quick conversion with cvs2git (latest from svn).

Result is here:

  https://github.com/markokr/pgjdbc-test

Attached files, so you can repeat it:

convert.sh - fetches cvs repo, converts it, pushes out
c2g.config.py - cvs2git config
c2g-config.diff - my changes to sample config

I grepped author list from git-dump.dat, so it should be reasonably
complete:

  awk '/^committer / { print $2; }' cvs2svn-tmp/git-dump.dat | sort -u

Also I checked for non-ascii symbols in commits with:

  LANG=C grep -E '[^  -~]' cvs2svn-tmp/git-dump.dat

and they look fine to me.  (there needs to be tab inside brackets,
^V^I may help)

Todo:
- fill author map
- spot problems

-- 
marko

Attachments:

  convert.sh (application/x-sh, 521B) download

c2g.config.py (text/x-python, 26.9K) download # (Be in -*- mode: python; coding: utf-8 -*- mode.) # # ==================================================================== # Copyright (c) 2006-2010 CollabNet. All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://subversion.tigris.org/license-1.html. # If newer versions of this license are posted there, you may use a # newer version instead, at your option. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs, available at http://cvs2svn.tigris.org/. # ==================================================================== # ##################### # ## PLEASE READ ME! ## # ##################### # # This is a template for an options file that can be used to configure # cvs2svn to convert to git rather than to Subversion. See # www/cvs2git.html and www/cvs2svn.html for general information, and # see the comments in this file for information about what options are # available and how they can be set. # # The program that is run to convert from CVS to git is called # cvs2git. Run it with the --options option, passing it this file # like this: # # cvs2git --options=cvs2git-example.options # # The output of cvs2git is a blob file and a dump file that can be # loaded into git using the "git fast-import" command. Please read # www/cvs2git.html for more information. # # Many options do not have defaults, so it is easier to copy this file # and modify what you need rather than creating a new options file # from scratch. This file is in Python syntax, but you don't need to # know Python to modify it. But if you *do* know Python, then you # will be happy to know that you can use arbitary Python constructs to # do fancy configuration tricks. # # But please be aware of the following: # # * In many places, leading whitespace is significant in Python (it is # used instead of curly braces to group statements together). # Therefore, if you don't know what you are doing, it is best to # leave the whitespace as it is. # # * In normal strings, Python treats a backslash ("\") as an escape # character. Therefore, if you want to specify a string that # contains a backslash, you need either to escape the backslash with # another backslash ("\\"), or use a "raw string", as in one if the # following equivalent examples: # # cvs_executable = 'c:\\windows\\system32\\cvs.exe' # cvs_executable = r'c:\windows\system32\cvs.exe' # # See http://docs.python.org/tutorial/introduction.html#strings for # more information. # # Two identifiers will have been defined before this file is executed, # and can be used freely within this file: # # ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds # many configuration options # # run_options -- an instance of the GitRunOptions class (see # cvs2svn_lib/git_run_options.py), which holds some variables # governing how cvs2git is run # Import some modules that are used in setting the options: import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder from cvs2svn_lib.log import logger from cvs2svn_lib.git_revision_collector import GitRevisionCollector from cvs2svn_lib.external_blob_generator import ExternalBlobGenerator from cvs2svn_lib.git_output_option import GitRevisionMarkWriter from cvs2svn_lib.git_output_option import GitOutputOption from cvs2svn_lib.dvcs_common import KeywordHandlingPropertySetter from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader from cvs2svn_lib.symbol_strategy import AllBranchRule from cvs2svn_lib.symbol_strategy import AllTagRule from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ExcludeTrivialImportBranchRule from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform from cvs2svn_lib.symbol_transform import RegexpSymbolTransform from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform from cvs2svn_lib.property_setters import AutoPropsPropertySetter from cvs2svn_lib.property_setters import ConditionalPropertySetter from cvs2svn_lib.property_setters import cvs_file_is_binary from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter from cvs2svn_lib.property_setters import DefaultEOLStyleSetter from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter from cvs2svn_lib.property_setters import ExecutablePropertySetter from cvs2svn_lib.property_setters import KeywordsPropertySetter from cvs2svn_lib.property_setters import MimeMapper from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: #logger.log_level = logger.WARN #logger.log_level = logger.QUIET logger.log_level = logger.NORMAL #logger.log_level = logger.VERBOSE #logger.log_level = logger.DEBUG # The directory to use for temporary files: ctx.tmpdir = r'cvs2svn-tmp' # During FilterSymbolsPass, cvs2git records the contents of file # revisions into a "blob" file in git-fast-import format. The # ctx.revision_collector option configures that process. Choose one of the two ersions and customize its options. # This first alternative is much slower but is better tested and has a # chance of working with CVSNT repositories. It invokes CVS or RCS to # reconstuct the contents of CVS file revisions: ctx.revision_collector = GitRevisionCollector( # The file in which to write the git-fast-import stream that # contains the file revision contents: 'cvs2svn-tmp/git-blob.dat', # The following option specifies how the revision contents of the # RCS files should be read. # # RCSRevisionReader uses RCS's "co" program to extract the # revision contents of the RCS files during CollectRevsPass. The # constructor argument specifies how to invoke the "co" # executable. # # CVSRevisionReader uses the "cvs" program to extract the revision # contents out of the RCS files during OutputPass. This option is # considerably slower than RCSRevisionReader because "cvs" is # considerably slower than "co". However, it works in some # situations where RCSRevisionReader fails; see the HTML # documentation of the "--use-cvs" option for details. The # constructor argument specifies how to invoke the "co" # executable. # # Uncomment one of the two following lines: #RCSRevisionReader(co_executable=r'co'), CVSRevisionReader(cvs_executable=r'cvs'), ) # This second alternative is vastly faster than the version above. It # uses an external Python program to reconstruct the contents of CVS # file revisions: #ctx.revision_collector = ExternalBlobGenerator('cvs2svn-tmp/git-blob.dat') # cvs2git doesn't need a revision reader because OutputPass only # refers to blobs that were output during CollectRevsPass, so leave # this option set to None. ctx.revision_reader = None # Change the following line to True if the conversion should only # include the trunk of the repository (i.e., all branches and tags # should be omitted from the conversion): ctx.trunk_only = False # How to convert CVS author names, log messages, and filenames to # Unicode. The first argument to CVSTextDecoder is a list of encoders # that are tried in order in 'strict' mode until one of them succeeds. # If none of those succeeds, then fallback_encoder (if it is # specified) is used in lossy 'replace' mode. Setting a fallback # encoder ensures that the encoder always succeeds, but it can cause # information loss. ctx.cvs_author_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) ctx.cvs_log_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii', eol_fix='\n', ) # You might want to be especially strict when converting filenames to # Unicode (e.g., maybe not specify a fallback_encoding). ctx.cvs_filename_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) # Template for the commit message to be used for initial project # commits. ctx.initial_project_commit_message = ( 'Standard project directories initialized by cvs2svn.' ) # Template for the commit message to be used for post commits, in # which modifications to a vendor branch are copied back to trunk. # This message can use '%(revnum)d' to include the SVN revision number # of the revision that included the change to the vendor branch # (admittedly rather pointless in a cvs2git conversion). ctx.post_commit_message = ( 'This commit was generated by cvs2svn to track changes on a CVS ' 'vendor branch.' ) # Template for the commit message to be used for commits in which # symbols are created. This message can use '%(symbol_type)s' to # include the type of the symbol ('branch' or 'tag') or # '%(symbol_name)s' to include the name of the symbol. ctx.symbol_commit_message = ( "This commit was manufactured by cvs2svn to create %(symbol_type)s " "'%(symbol_name)s'." ) # Template for the commit message to be used for commits in which # tags are pseudo-merged back to their source branch. This message can # use '%(symbol_name)s' to include the name of the symbol. # (Not used by default unless you enable tie_tag_fixup_branches on # GitOutputOption.) ctx.tie_tag_ancestry_message = ( "This commit was manufactured by cvs2svn to tie ancestry for " "tag '%(symbol_name)s' back to the source branch." ) # Some CVS clients for MacOS store resource fork data into CVS along # with the file contents itself by wrapping it all up in a container # format called "AppleSingle". Subversion currently does not support # MacOS resource forks. Nevertheless, sometimes the resource fork # information is not necessary and can be discarded. Set the # following option to True if you would like cvs2svn to identify files # whose contents are encoded in AppleSingle format, and discard all # but the data fork for such files before committing them to # Subversion. (Please note that AppleSingle contents are identified # by the AppleSingle magic number as the first four bytes of the file. # This check is not failproof, so only set this option if you think # you need it.) ctx.decode_apple_single = False # This option can be set to the name of a filename to which are stored # statistics and conversion decisions about the CVS symbols. ctx.symbol_info_filename = None #ctx.symbol_info_filename = 'symbol-info.txt' # cvs2svn uses "symbol strategy rules" to help decide how to handle # CVS symbols. The rules in a project's symbol_strategy_rules are # applied in order, and each rule is allowed to modify the symbol. # The result (after each of the rules has been applied) is used for # the conversion. # # 1. A CVS symbol might be used as a tag in one file and as a branch # in another file. cvs2svn has to decide whether to convert such a # symbol as a tag or as a branch. cvs2svn uses a series of # heuristic rules to decide how to convert a symbol. The user can # override the default rules for specific symbols or symbols # matching regular expressions. # # 2. cvs2svn is also capable of excluding symbols from the conversion # (provided no other symbols depend on them. # # 3. CVS does not record unambiguously the line of development from # which a symbol sprouted. cvs2svn uses a heuristic to choose a # symbol's "preferred parents". # # The standard branch/tag/exclude StrategyRules do not change a symbol # that has already been processed by an earlier rule, so in effect the # first matching rule is the one that is used. global_symbol_strategy_rules = [ # It is possible to specify manually exactly how symbols should be # converted and what line of development should be used as the # preferred parent. To do so, create a file containing the symbol # hints and enable the following option. # # The format of the hints file is described in the documentation # for the --symbol-hints command-line option. The file output by # the --write-symbol-info (i.e., ctx.symbol_info_filename) option # is in the same format. The simplest way to use this option is # to run the conversion through CollateSymbolsPass with # --write-symbol-info option, copy the symbol info and edit it to # create a hints file, then re-start the conversion at # CollateSymbolsPass with this option enabled. #SymbolHintsFileRule('symbol-hints.txt'), # To force all symbols matching a regular expression to be # converted as branches, add rules like the following: #ForceBranchRegexpStrategyRule(r'branch.*'), # To force all symbols matching a regular expression to be # converted as tags, add rules like the following: #ForceTagRegexpStrategyRule(r'tag.*'), # To force all symbols matching a regular expression to be # excluded from the conversion, add rules like the following: #ExcludeRegexpStrategyRule(r'unknown-.*'), # Sometimes people use "cvs import" to get their own source code # into CVS. This practice creates a vendor branch 1.1.1 and # imports the code onto the vendor branch as 1.1.1.1, then copies # the same content to the trunk as version 1.1. Normally, such # vendor branches are useless and they complicate the SVN history # unnecessarily. The following rule excludes any branches that # only existed as a vendor branch with a single import (leaving # only the 1.1 revision). If you want to retain such branches, # comment out the following line. (Please note that this rule # does not exclude vendor *tags*, as they are not so easy to # identify.) ExcludeTrivialImportBranchRule(), # To exclude all vendor branches (branches that had "cvs import"s # on them but no other kinds of commits), uncomment the following # line: #ExcludeVendorBranchRule(), # Usually you want this rule, to convert unambiguous symbols # (symbols that were only ever used as tags or only ever used as # branches in CVS) the same way they were used in CVS: UnambiguousUsageRule(), # If there was ever a commit on a symbol, then it cannot be # converted as a tag. This rule causes all such symbols to be # converted as branches. If you would like to resolve such # ambiguities manually, comment out the following line: BranchIfCommitsRule(), # Last in the list can be a catch-all rule that is used for # symbols that were not matched by any of the more specific rules # above. (Assuming that BranchIfCommitsRule() was included above, # then the symbols that are still indeterminate at this point can # sensibly be converted as branches or tags.) Include at most one # of these lines. If none of these catch-all rules are included, # then the presence of any ambiguous symbols (that haven't been # disambiguated above) is an error: # Convert ambiguous symbols based on whether they were used more # often as branches or as tags: HeuristicStrategyRule(), # Convert all ambiguous symbols as branches: #AllBranchRule(), # Convert all ambiguous symbols as tags: #AllTagRule(), # The last rule is here to choose the preferred parent of branches # and tags, that is, the line of development from which the symbol # sprouts. HeuristicPreferredParentRule(), ] # Specify a username to be used for commits for which CVS doesn't # record the original author (for example, the creation of a branch). # This should be a simple (unix-style) username, but it can be # translated into a git-style name by the author_transforms map. ctx.username = 'cvs2git' # ctx.file_property_setters and ctx.revision_property_setters contain # rules used to set the svn properties on files in the converted # archive. For each file, the rules are tried one by one. Any rule # can add or suppress one or more svn properties. Typically the rules # will not overwrite properties set by a previous rule (though they # are free to do so). ctx.file_property_setters should be used for # properties that remain the same for the life of the file; these # should implement FilePropertySetter. ctx.revision_property_setters # should be used for properties that are allowed to vary from revision # to revision; these should implement RevisionPropertySetter. # # Obviously, SVN properties per se are not interesting for a cvs2git # conversion, but some of these properties have side-effects that do # affect the git output. FIXME: Document this in more detail. ctx.file_property_setters.extend([ # To read auto-props rules from a file, uncomment the following line # and specify a filename. The boolean argument specifies whether # case should be ignored when matching filenames to the filename # patterns found in the auto-props file: #AutoPropsPropertySetter( # r'/home/username/.subversion/config', # ignore_case=True, # ), # To read mime types from a file and use them to set svn:mime-type # based on the filename extensions, uncomment the following line # and specify a filename (see # http://en.wikipedia.org/wiki/Mime.types for information about # mime.types files): #MimeMapper(r'/etc/mime.types', ignore_case=False), # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), # To try to determine the eol-style from the mime type, uncomment # the following line: #EOLStyleFromMimeTypeSetter(), # Choose one of the following lines to set the default # svn:eol-style if none of the above rules applied. The argument # is the svn:eol-style that should be applied, or None if no # svn:eol-style should be set (i.e., the file should be treated as # binary). # # The default is to treat all files as binary unless one of the # previous rules has determined otherwise, because this is the # safest approach. However, if you have been diligent about # marking binary files with -kb in CVS and/or you have used the # above rules to definitely mark binary files as binary, then you # might prefer to use 'native' as the default, as it is usually # the most convenient setting for text files. Other possible # options: 'CRLF', 'CR', 'LF'. DefaultEOLStyleSetter(None), #DefaultEOLStyleSetter('native'), # Prevent svn:keywords from being set on files that have # svn:eol-style unset. SVNBinaryFileKeywordsPropertySetter(), # If svn:keywords has not been set yet, set it based on the file's # CVS mode: KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE), # Set the svn:executable flag on any files that are marked in CVS as # being executable: ExecutablePropertySetter(), # The following causes keywords to be untouched in binary files and # collapsed in all text to be committed: ConditionalPropertySetter( cvs_file_is_binary, KeywordHandlingPropertySetter('untouched'), ), KeywordHandlingPropertySetter('collapsed'), ]) ctx.revision_property_setters.extend([ ]) # To skip the cleanup of temporary files, uncomment the following # option: #ctx.skip_cleanup = True # In CVS, it is perfectly possible to make a single commit that # affects more than one project or more than one branch of a single # project. Subversion also allows such commits. Therefore, by # default, when cvs2svn sees what looks like a cross-project or # cross-branch CVS commit, it converts it into a # cross-project/cross-branch Subversion commit. # # However, other tools and SCMs have trouble representing # cross-project or cross-branch commits. (For example, Trac's Revtree # plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by # such commits.) Therefore, we provide the following two options to # allow cross-project/cross-branch commits to be suppressed. # cvs2git only supports single-project conversions (multiple-project # conversions wouldn't really make sense for git anyway). So this # option must be set to False: ctx.cross_project_commits = False # git itself doesn't allow commits that affect more than one branch, # so this option must be set to False: ctx.cross_branch_commits = False # cvs2git does not yet handle translating .cvsignore files into # .gitignore files, so by default, the .cvsignore files are included # in the conversion output. If you would like to omit the .cvsignore # files from the output, set this option to False: ctx.keep_cvsignore = True # By default, it is a fatal error for a CVS ",v" file to appear both # inside and outside of an "Attic" subdirectory (this should never # happen, but frequently occurs due to botched repository # administration). If you would like to retain both versions of such # files, change the following option to True, and the attic version of # the file will be written to a subdirectory called "Attic" in the # output repository: ctx.retain_conflicting_attic_files = False # CVS uses unix login names as author names whereas git requires # author names to be of the form "foo <bar>". The default is to set # the git author to "cvsauthor <cvsauthor>". author_transforms can be # used to map cvsauthor names (e.g., "jrandom") to a true name and # email address (e.g., "J. Random <jrandom@example.com>" for the # example shown). All strings should be either Unicode strings (i.e., # with "u" as a prefix) or 8-bit strings in the utf-8 encoding. The # values can either be strings in the form "name <email>" or tuples # (name, email). Please substitute your own project's usernames here # to use with the author_transforms option of GitOutputOption below. author_transforms={ 'barry': 'barry <>', 'blind': 'blind <>', 'cvs2git': 'cvs2git <>', 'davec': 'davec <>', 'davecramer': 'davecramer <>', 'jurka': 'jurka <>', 'momjian': 'momjian <>', 'oliver': 'oliver <>', 'peter': 'peter <>', 'petere': 'petere <>', 'pgsql': 'pgsql <>', 'scrappy': 'scrappy <>', 'tgl': 'tgl <>', 'thomas': 'thomas <>', 'wieck': 'wieck <>', } # This is the main option that causes cvs2svn to output to a # "fastimport"-format dumpfile rather than to Subversion: ctx.output_option = GitOutputOption( # The file in which to write the git-fast-import stream that # contains the changesets and branch/tag information: os.path.join(ctx.tmpdir, 'git-dump.dat'), # The blobs will be written via the revision recorder, so in # OutputPass we only have to emit references to the blob marks: GitRevisionMarkWriter(), # Optional map from CVS author names to git author names: author_transforms=author_transforms, ) # Change this option to True to turn on profiling of cvs2svn (for # debugging purposes): run_options.profiling = False # Should CVSItem -> Changeset database files be memory mapped? In # some tests, using memory mapping speeded up the overall conversion # by about 5%. But this option can cause the conversion to fail with # an out of memory error if the conversion computer runs out of # virtual address space (e.g., when running a very large conversion on # a 32-bit operating system). Therefore it is disabled by default. # Uncomment the following line to allow these database files to be # memory mapped. #changeset_database.use_mmap_for_cvs_item_to_changeset_table = True # Now set the project to be converted to git. cvs2git only supports # single-project conversions, so this method must only be called # once: run_options.set_project( # The filesystem path to the part of the CVS repository (*not* a # CVS working copy) that should be converted. This may be a # subdirectory (i.e., a module) within a larger CVS repository. r'pgjdbc', # A list of symbol transformations that can be used to rename # symbols in this project. symbol_transforms=[ # Use IgnoreSymbolTransforms like the following to completely # ignore symbols matching a regular expression when parsing # the CVS repository, for example to avoid warnings about # branches with two names and to choose the preferred name. # It is *not* recommended to use this instead of # ExcludeRegexpStrategyRule; though more efficient, # IgnoreSymbolTransforms are less flexible and don't exclude # branches correctly. The argument is a Python-style regular # expression that has to match the *whole* CVS symbol name: #IgnoreSymbolTransform(r'nightly-build-tag-.*') # RegexpSymbolTransforms transform symbols textually using a # regular expression. The first argument is a Python regular # expression pattern and the second is a replacement pattern. # The pattern is matched against each symbol name. If it # matches the whole symbol name, then the symbol name is # replaced with the corresponding replacement text. The # replacement can include substitution patterns (e.g., r'\1' # or r'\g<name>'). Typically you will want to use raw strings # (strings with a preceding 'r', like shown in the examples) # for the regexp and its replacement to avoid backslash # substitution within those strings. #RegexpSymbolTransform(r'release-(\d+)_(\d+)', # r'release-\1.\2'), #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)', # r'release-\1.\2.\3'), # Simple 1:1 character replacements can also be done. The # following transform, which converts backslashes into forward # slashes, should usually be included: ReplaceSubstringsSymbolTransform('\\','/'), # This last rule eliminates leading, trailing, and repeated # slashes within the output symbol names: NormalizePathsSymbolTransform(), ], # See the definition of global_symbol_strategy_rules above for a # description of this option: symbol_strategy_rules=global_symbol_strategy_rules, # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], )
c2g.config.diff (text/x-diff, 2.7K) download --- cvs2git-example.options 2011-10-05 08:47:13.725085583 +0200 +++ c2g.config.py 2011-10-05 09:35:07.704509246 +0200 @@ -182,16 +182,16 @@ # information loss. ctx.cvs_author_decoder = CVSTextDecoder( [ - #'utf8', - #'latin1', + 'utf8', + 'latin1', 'ascii', ], #fallback_encoding='ascii' ) ctx.cvs_log_decoder = CVSTextDecoder( [ - #'utf8', - #'latin1', + 'utf8', + 'latin1', 'ascii', ], #fallback_encoding='ascii', @@ -201,8 +201,8 @@ # Unicode (e.g., maybe not specify a fallback_encoding). ctx.cvs_filename_decoder = CVSTextDecoder( [ - #'utf8', - #'latin1', + 'utf8', + 'latin1', 'ascii', ], #fallback_encoding='ascii' @@ -370,7 +370,7 @@ # record the original author (for example, the creation of a branch). # This should be a simple (unix-style) username, but it can be # translated into a git-style name by the author_transforms map. -ctx.username = 'cvs2svn' +ctx.username = 'cvs2git' # ctx.file_property_setters and ctx.revision_property_setters contain # rules used to set the svn properties on files in the converted @@ -508,16 +508,22 @@ # (name, email). Please substitute your own project's usernames here # to use with the author_transforms option of GitOutputOption below. author_transforms={ - 'jrandom' : ('J. Random', 'jrandom@example.com'), - 'mhagger' : 'Michael Haggerty <mhagger@alum.mit.edu>', - 'brane' : (u'Branko Čibej', 'brane@xbc.nu'), - 'ringstrom' : 'Tobias Ringström <tobias@ringstrom.mine.nu>', - 'dionisos' : (u'Erik Hülsmann', 'e.huelsmann@gmx.net'), - - # This one will be used for commits for which CVS doesn't record - # the original author, as explained above. - 'cvs2svn' : 'cvs2svn <admin@example.com>', - } +'barry': 'barry <>', +'blind': 'blind <>', +'cvs2git': 'cvs2git <>', +'davec': 'davec <>', +'davecramer': 'davecramer <>', +'jurka': 'jurka <>', +'momjian': 'momjian <>', +'oliver': 'oliver <>', +'peter': 'peter <>', +'petere': 'petere <>', +'pgsql': 'pgsql <>', +'scrappy': 'scrappy <>', +'tgl': 'tgl <>', +'thomas': 'thomas <>', +'wieck': 'wieck <>', +} # This is the main option that causes cvs2svn to output to a # "fastimport"-format dumpfile rather than to Subversion: @@ -556,7 +562,7 @@ # The filesystem path to the part of the CVS repository (*not* a # CVS working copy) that should be converted. This may be a # subdirectory (i.e., a module) within a larger CVS repository. - r'test-data/main-cvsrepos', + r'pgjdbc', # A list of symbol transformations that can be used to rename # symbols in this project.
^ permalink raw reply [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 10:04  Marko Kreen <markokr@gmail.com>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-05 10:04 UTC (permalink / raw)
  To: pgsql-jdbc

On Wed, Oct 5, 2011 at 9:42 AM, Marko Kreen <markokr@gmail.com> wrote:
> Todo:
> - fill author map
> - spot problems

I found author map from https://github.com/mhagander/pggit_migrate
and used that (blind and oliver i guessed).  Also renamed
cvs2svn to cvs2git in config.

Few uncertain areas that I know of:
- What to do with keywords?  Curretly they are squashed.
- What to do with .cvsignore.  There is option of skipping them.
  [I would prefer explicit commit that converts them to .gitignore]
- There are few manufactured commits on branches (not on HEAD):

$ grep -i cvs2 cvs2svn-tmp/git-dump.dat
This commit was manufactured by cvs2git to create branch 'REL6_4'.
This commit was manufactured by cvs2git to create tag 'REL7_1_BETA'.
This commit was manufactured by cvs2git to create tag 'REL7_1'.
This commit was manufactured by cvs2git to create branch 'REL7_3_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL7_4_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL7_4_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_0_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_2_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_1_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_2_STABLE'.
This commit was manufactured by cvs2git to create tag 'REL8_2_505'.
This commit was manufactured by cvs2git to create branch 'REL8_0_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_1_STABLE'.
This commit was manufactured by cvs2git to create branch 'REL8_2_STABLE'.

So the question is does the code look sane around those points
and do we need to do something with it.  As cvs2git has seen improvements
since postgres conversion, perhaps they are ok and we can ignore those.
Especially since they are only on older branches.

New config attached.  No changes to convert script.

-- 
marko

Attachments:

c2g.config.py (text/x-python, 27.4K) download # (Be in -*- mode: python; coding: utf-8 -*- mode.) # # ==================================================================== # Copyright (c) 2006-2010 CollabNet. All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://subversion.tigris.org/license-1.html. # If newer versions of this license are posted there, you may use a # newer version instead, at your option. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs, available at http://cvs2svn.tigris.org/. # ==================================================================== # ##################### # ## PLEASE READ ME! ## # ##################### # # This is a template for an options file that can be used to configure # cvs2svn to convert to git rather than to Subversion. See # www/cvs2git.html and www/cvs2svn.html for general information, and # see the comments in this file for information about what options are # available and how they can be set. # # The program that is run to convert from CVS to git is called # cvs2git. Run it with the --options option, passing it this file # like this: # # cvs2git --options=cvs2git-example.options # # The output of cvs2git is a blob file and a dump file that can be # loaded into git using the "git fast-import" command. Please read # www/cvs2git.html for more information. # # Many options do not have defaults, so it is easier to copy this file # and modify what you need rather than creating a new options file # from scratch. This file is in Python syntax, but you don't need to # know Python to modify it. But if you *do* know Python, then you # will be happy to know that you can use arbitary Python constructs to # do fancy configuration tricks. # # But please be aware of the following: # # * In many places, leading whitespace is significant in Python (it is # used instead of curly braces to group statements together). # Therefore, if you don't know what you are doing, it is best to # leave the whitespace as it is. # # * In normal strings, Python treats a backslash ("\") as an escape # character. Therefore, if you want to specify a string that # contains a backslash, you need either to escape the backslash with # another backslash ("\\"), or use a "raw string", as in one if the # following equivalent examples: # # cvs_executable = 'c:\\windows\\system32\\cvs.exe' # cvs_executable = r'c:\windows\system32\cvs.exe' # # See http://docs.python.org/tutorial/introduction.html#strings for # more information. # # Two identifiers will have been defined before this file is executed, # and can be used freely within this file: # # ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds # many configuration options # # run_options -- an instance of the GitRunOptions class (see # cvs2svn_lib/git_run_options.py), which holds some variables # governing how cvs2git is run # Import some modules that are used in setting the options: import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder from cvs2svn_lib.log import logger from cvs2svn_lib.git_revision_collector import GitRevisionCollector from cvs2svn_lib.external_blob_generator import ExternalBlobGenerator from cvs2svn_lib.git_output_option import GitRevisionMarkWriter from cvs2svn_lib.git_output_option import GitOutputOption from cvs2svn_lib.dvcs_common import KeywordHandlingPropertySetter from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader from cvs2svn_lib.symbol_strategy import AllBranchRule from cvs2svn_lib.symbol_strategy import AllTagRule from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ExcludeTrivialImportBranchRule from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform from cvs2svn_lib.symbol_transform import RegexpSymbolTransform from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform from cvs2svn_lib.property_setters import AutoPropsPropertySetter from cvs2svn_lib.property_setters import ConditionalPropertySetter from cvs2svn_lib.property_setters import cvs_file_is_binary from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter from cvs2svn_lib.property_setters import DefaultEOLStyleSetter from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter from cvs2svn_lib.property_setters import ExecutablePropertySetter from cvs2svn_lib.property_setters import KeywordsPropertySetter from cvs2svn_lib.property_setters import MimeMapper from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: #logger.log_level = logger.WARN #logger.log_level = logger.QUIET logger.log_level = logger.NORMAL #logger.log_level = logger.VERBOSE #logger.log_level = logger.DEBUG # The directory to use for temporary files: ctx.tmpdir = r'cvs2svn-tmp' # During FilterSymbolsPass, cvs2git records the contents of file # revisions into a "blob" file in git-fast-import format. The # ctx.revision_collector option configures that process. Choose one of the two ersions and customize its options. # This first alternative is much slower but is better tested and has a # chance of working with CVSNT repositories. It invokes CVS or RCS to # reconstuct the contents of CVS file revisions: ctx.revision_collector = GitRevisionCollector( # The file in which to write the git-fast-import stream that # contains the file revision contents: 'cvs2svn-tmp/git-blob.dat', # The following option specifies how the revision contents of the # RCS files should be read. # # RCSRevisionReader uses RCS's "co" program to extract the # revision contents of the RCS files during CollectRevsPass. The # constructor argument specifies how to invoke the "co" # executable. # # CVSRevisionReader uses the "cvs" program to extract the revision # contents out of the RCS files during OutputPass. This option is # considerably slower than RCSRevisionReader because "cvs" is # considerably slower than "co". However, it works in some # situations where RCSRevisionReader fails; see the HTML # documentation of the "--use-cvs" option for details. The # constructor argument specifies how to invoke the "co" # executable. # # Uncomment one of the two following lines: #RCSRevisionReader(co_executable=r'co'), CVSRevisionReader(cvs_executable=r'cvs'), ) # This second alternative is vastly faster than the version above. It # uses an external Python program to reconstruct the contents of CVS # file revisions: #ctx.revision_collector = ExternalBlobGenerator('cvs2svn-tmp/git-blob.dat') # cvs2git doesn't need a revision reader because OutputPass only # refers to blobs that were output during CollectRevsPass, so leave # this option set to None. ctx.revision_reader = None # Change the following line to True if the conversion should only # include the trunk of the repository (i.e., all branches and tags # should be omitted from the conversion): ctx.trunk_only = False # How to convert CVS author names, log messages, and filenames to # Unicode. The first argument to CVSTextDecoder is a list of encoders # that are tried in order in 'strict' mode until one of them succeeds. # If none of those succeeds, then fallback_encoder (if it is # specified) is used in lossy 'replace' mode. Setting a fallback # encoder ensures that the encoder always succeeds, but it can cause # information loss. ctx.cvs_author_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) ctx.cvs_log_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii', eol_fix='\n', ) # You might want to be especially strict when converting filenames to # Unicode (e.g., maybe not specify a fallback_encoding). ctx.cvs_filename_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) # Template for the commit message to be used for initial project # commits. ctx.initial_project_commit_message = ( 'Standard project directories initialized by cvs2git.' ) # Template for the commit message to be used for post commits, in # which modifications to a vendor branch are copied back to trunk. # This message can use '%(revnum)d' to include the SVN revision number # of the revision that included the change to the vendor branch # (admittedly rather pointless in a cvs2git conversion). ctx.post_commit_message = ( 'This commit was generated by cvs2git to track changes on a CVS ' 'vendor branch.' ) # Template for the commit message to be used for commits in which # symbols are created. This message can use '%(symbol_type)s' to # include the type of the symbol ('branch' or 'tag') or # '%(symbol_name)s' to include the name of the symbol. ctx.symbol_commit_message = ( "This commit was manufactured by cvs2git to create %(symbol_type)s " "'%(symbol_name)s'." ) # Template for the commit message to be used for commits in which # tags are pseudo-merged back to their source branch. This message can # use '%(symbol_name)s' to include the name of the symbol. # (Not used by default unless you enable tie_tag_fixup_branches on # GitOutputOption.) ctx.tie_tag_ancestry_message = ( "This commit was manufactured by cvs2git to tie ancestry for " "tag '%(symbol_name)s' back to the source branch." ) # Some CVS clients for MacOS store resource fork data into CVS along # with the file contents itself by wrapping it all up in a container # format called "AppleSingle". Subversion currently does not support # MacOS resource forks. Nevertheless, sometimes the resource fork # information is not necessary and can be discarded. Set the # following option to True if you would like cvs2svn to identify files # whose contents are encoded in AppleSingle format, and discard all # but the data fork for such files before committing them to # Subversion. (Please note that AppleSingle contents are identified # by the AppleSingle magic number as the first four bytes of the file. # This check is not failproof, so only set this option if you think # you need it.) ctx.decode_apple_single = False # This option can be set to the name of a filename to which are stored # statistics and conversion decisions about the CVS symbols. ctx.symbol_info_filename = None #ctx.symbol_info_filename = 'symbol-info.txt' # cvs2svn uses "symbol strategy rules" to help decide how to handle # CVS symbols. The rules in a project's symbol_strategy_rules are # applied in order, and each rule is allowed to modify the symbol. # The result (after each of the rules has been applied) is used for # the conversion. # # 1. A CVS symbol might be used as a tag in one file and as a branch # in another file. cvs2svn has to decide whether to convert such a # symbol as a tag or as a branch. cvs2svn uses a series of # heuristic rules to decide how to convert a symbol. The user can # override the default rules for specific symbols or symbols # matching regular expressions. # # 2. cvs2svn is also capable of excluding symbols from the conversion # (provided no other symbols depend on them. # # 3. CVS does not record unambiguously the line of development from # which a symbol sprouted. cvs2svn uses a heuristic to choose a # symbol's "preferred parents". # # The standard branch/tag/exclude StrategyRules do not change a symbol # that has already been processed by an earlier rule, so in effect the # first matching rule is the one that is used. global_symbol_strategy_rules = [ # It is possible to specify manually exactly how symbols should be # converted and what line of development should be used as the # preferred parent. To do so, create a file containing the symbol # hints and enable the following option. # # The format of the hints file is described in the documentation # for the --symbol-hints command-line option. The file output by # the --write-symbol-info (i.e., ctx.symbol_info_filename) option # is in the same format. The simplest way to use this option is # to run the conversion through CollateSymbolsPass with # --write-symbol-info option, copy the symbol info and edit it to # create a hints file, then re-start the conversion at # CollateSymbolsPass with this option enabled. #SymbolHintsFileRule('symbol-hints.txt'), # To force all symbols matching a regular expression to be # converted as branches, add rules like the following: #ForceBranchRegexpStrategyRule(r'branch.*'), # To force all symbols matching a regular expression to be # converted as tags, add rules like the following: #ForceTagRegexpStrategyRule(r'tag.*'), # To force all symbols matching a regular expression to be # excluded from the conversion, add rules like the following: #ExcludeRegexpStrategyRule(r'unknown-.*'), # Sometimes people use "cvs import" to get their own source code # into CVS. This practice creates a vendor branch 1.1.1 and # imports the code onto the vendor branch as 1.1.1.1, then copies # the same content to the trunk as version 1.1. Normally, such # vendor branches are useless and they complicate the SVN history # unnecessarily. The following rule excludes any branches that # only existed as a vendor branch with a single import (leaving # only the 1.1 revision). If you want to retain such branches, # comment out the following line. (Please note that this rule # does not exclude vendor *tags*, as they are not so easy to # identify.) ExcludeTrivialImportBranchRule(), # To exclude all vendor branches (branches that had "cvs import"s # on them but no other kinds of commits), uncomment the following # line: #ExcludeVendorBranchRule(), # Usually you want this rule, to convert unambiguous symbols # (symbols that were only ever used as tags or only ever used as # branches in CVS) the same way they were used in CVS: UnambiguousUsageRule(), # If there was ever a commit on a symbol, then it cannot be # converted as a tag. This rule causes all such symbols to be # converted as branches. If you would like to resolve such # ambiguities manually, comment out the following line: BranchIfCommitsRule(), # Last in the list can be a catch-all rule that is used for # symbols that were not matched by any of the more specific rules # above. (Assuming that BranchIfCommitsRule() was included above, # then the symbols that are still indeterminate at this point can # sensibly be converted as branches or tags.) Include at most one # of these lines. If none of these catch-all rules are included, # then the presence of any ambiguous symbols (that haven't been # disambiguated above) is an error: # Convert ambiguous symbols based on whether they were used more # often as branches or as tags: HeuristicStrategyRule(), # Convert all ambiguous symbols as branches: #AllBranchRule(), # Convert all ambiguous symbols as tags: #AllTagRule(), # The last rule is here to choose the preferred parent of branches # and tags, that is, the line of development from which the symbol # sprouts. HeuristicPreferredParentRule(), ] # Specify a username to be used for commits for which CVS doesn't # record the original author (for example, the creation of a branch). # This should be a simple (unix-style) username, but it can be # translated into a git-style name by the author_transforms map. ctx.username = 'cvs2git' # ctx.file_property_setters and ctx.revision_property_setters contain # rules used to set the svn properties on files in the converted # archive. For each file, the rules are tried one by one. Any rule # can add or suppress one or more svn properties. Typically the rules # will not overwrite properties set by a previous rule (though they # are free to do so). ctx.file_property_setters should be used for # properties that remain the same for the life of the file; these # should implement FilePropertySetter. ctx.revision_property_setters # should be used for properties that are allowed to vary from revision # to revision; these should implement RevisionPropertySetter. # # Obviously, SVN properties per se are not interesting for a cvs2git # conversion, but some of these properties have side-effects that do # affect the git output. FIXME: Document this in more detail. ctx.file_property_setters.extend([ # To read auto-props rules from a file, uncomment the following line # and specify a filename. The boolean argument specifies whether # case should be ignored when matching filenames to the filename # patterns found in the auto-props file: #AutoPropsPropertySetter( # r'/home/username/.subversion/config', # ignore_case=True, # ), # To read mime types from a file and use them to set svn:mime-type # based on the filename extensions, uncomment the following line # and specify a filename (see # http://en.wikipedia.org/wiki/Mime.types for information about # mime.types files): #MimeMapper(r'/etc/mime.types', ignore_case=False), # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), # To try to determine the eol-style from the mime type, uncomment # the following line: #EOLStyleFromMimeTypeSetter(), # Choose one of the following lines to set the default # svn:eol-style if none of the above rules applied. The argument # is the svn:eol-style that should be applied, or None if no # svn:eol-style should be set (i.e., the file should be treated as # binary). # # The default is to treat all files as binary unless one of the # previous rules has determined otherwise, because this is the # safest approach. However, if you have been diligent about # marking binary files with -kb in CVS and/or you have used the # above rules to definitely mark binary files as binary, then you # might prefer to use 'native' as the default, as it is usually # the most convenient setting for text files. Other possible # options: 'CRLF', 'CR', 'LF'. DefaultEOLStyleSetter(None), #DefaultEOLStyleSetter('native'), # Prevent svn:keywords from being set on files that have # svn:eol-style unset. SVNBinaryFileKeywordsPropertySetter(), # If svn:keywords has not been set yet, set it based on the file's # CVS mode: KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE), # Set the svn:executable flag on any files that are marked in CVS as # being executable: ExecutablePropertySetter(), # The following causes keywords to be untouched in binary files and # collapsed in all text to be committed: ConditionalPropertySetter( cvs_file_is_binary, KeywordHandlingPropertySetter('untouched'), ), KeywordHandlingPropertySetter('collapsed'), ]) ctx.revision_property_setters.extend([ ]) # To skip the cleanup of temporary files, uncomment the following # option: #ctx.skip_cleanup = True # In CVS, it is perfectly possible to make a single commit that # affects more than one project or more than one branch of a single # project. Subversion also allows such commits. Therefore, by # default, when cvs2svn sees what looks like a cross-project or # cross-branch CVS commit, it converts it into a # cross-project/cross-branch Subversion commit. # # However, other tools and SCMs have trouble representing # cross-project or cross-branch commits. (For example, Trac's Revtree # plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by # such commits.) Therefore, we provide the following two options to # allow cross-project/cross-branch commits to be suppressed. # cvs2git only supports single-project conversions (multiple-project # conversions wouldn't really make sense for git anyway). So this # option must be set to False: ctx.cross_project_commits = False # git itself doesn't allow commits that affect more than one branch, # so this option must be set to False: ctx.cross_branch_commits = False # cvs2git does not yet handle translating .cvsignore files into # .gitignore files, so by default, the .cvsignore files are included # in the conversion output. If you would like to omit the .cvsignore # files from the output, set this option to False: ctx.keep_cvsignore = True # By default, it is a fatal error for a CVS ",v" file to appear both # inside and outside of an "Attic" subdirectory (this should never # happen, but frequently occurs due to botched repository # administration). If you would like to retain both versions of such # files, change the following option to True, and the attic version of # the file will be written to a subdirectory called "Attic" in the # output repository: ctx.retain_conflicting_attic_files = False # CVS uses unix login names as author names whereas git requires # author names to be of the form "foo <bar>". The default is to set # the git author to "cvsauthor <cvsauthor>". author_transforms can be # used to map cvsauthor names (e.g., "jrandom") to a true name and # email address (e.g., "J. Random <jrandom@example.com>" for the # example shown). All strings should be either Unicode strings (i.e., # with "u" as a prefix) or 8-bit strings in the utf-8 encoding. The # values can either be strings in the form "name <email>" or tuples # (name, email). Please substitute your own project's usernames here # to use with the author_transforms option of GitOutputOption below. author_transforms={ 'barry' : ('Barry Lind', 'barry@xythos.com'), 'blind' : ('Barry Lind', 'barry@xythos.com'), 'cvs2git': ('CVS to git conversion script', 'webmaster@postgresql.org'), 'davec' : ('Dave Cramer', 'davec@fastcrypt.com'), 'davecramer' : ('Dave Cramer', 'davec@fastcrypt.com'), 'jurka' : ('Kris Jurka', 'books@ejurka.com'), 'momjian' : ('Bruce Momjian', 'bruce@momjian.us'), 'oliver': ('Oliver Jowett', 'oliver@opencloud.com'), 'peter' : ('Peter Mount', 'peter@retep.org.uk'), 'petere' : ('Peter Eisentraut', 'peter_e@gmx.net'), 'pgsql' : ('PostgreSQL Daemon', 'webmaster@postgresql.org'), 'scrappy' : ('Marc G. Fournier', 'scrappy@hub.org'), 'tgl' : ('Tom Lane', 'tgl@sss.pgh.pa.us'), 'thomas' : ('Thomas G. Lockhart', 'lockhart@fourpalms.org'), 'wieck' : ('Jan Wieck', 'JanWieck@Yahoo.com'), } # This is the main option that causes cvs2svn to output to a # "fastimport"-format dumpfile rather than to Subversion: ctx.output_option = GitOutputOption( # The file in which to write the git-fast-import stream that # contains the changesets and branch/tag information: os.path.join(ctx.tmpdir, 'git-dump.dat'), # The blobs will be written via the revision recorder, so in # OutputPass we only have to emit references to the blob marks: GitRevisionMarkWriter(), # Optional map from CVS author names to git author names: author_transforms=author_transforms, ) # Change this option to True to turn on profiling of cvs2svn (for # debugging purposes): run_options.profiling = False # Should CVSItem -> Changeset database files be memory mapped? In # some tests, using memory mapping speeded up the overall conversion # by about 5%. But this option can cause the conversion to fail with # an out of memory error if the conversion computer runs out of # virtual address space (e.g., when running a very large conversion on # a 32-bit operating system). Therefore it is disabled by default. # Uncomment the following line to allow these database files to be # memory mapped. #changeset_database.use_mmap_for_cvs_item_to_changeset_table = True # Now set the project to be converted to git. cvs2git only supports # single-project conversions, so this method must only be called # once: run_options.set_project( # The filesystem path to the part of the CVS repository (*not* a # CVS working copy) that should be converted. This may be a # subdirectory (i.e., a module) within a larger CVS repository. r'pgjdbc', # A list of symbol transformations that can be used to rename # symbols in this project. symbol_transforms=[ # Use IgnoreSymbolTransforms like the following to completely # ignore symbols matching a regular expression when parsing # the CVS repository, for example to avoid warnings about # branches with two names and to choose the preferred name. # It is *not* recommended to use this instead of # ExcludeRegexpStrategyRule; though more efficient, # IgnoreSymbolTransforms are less flexible and don't exclude # branches correctly. The argument is a Python-style regular # expression that has to match the *whole* CVS symbol name: #IgnoreSymbolTransform(r'nightly-build-tag-.*') # RegexpSymbolTransforms transform symbols textually using a # regular expression. The first argument is a Python regular # expression pattern and the second is a replacement pattern. # The pattern is matched against each symbol name. If it # matches the whole symbol name, then the symbol name is # replaced with the corresponding replacement text. The # replacement can include substitution patterns (e.g., r'\1' # or r'\g<name>'). Typically you will want to use raw strings # (strings with a preceding 'r', like shown in the examples) # for the regexp and its replacement to avoid backslash # substitution within those strings. #RegexpSymbolTransform(r'release-(\d+)_(\d+)', # r'release-\1.\2'), #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)', # r'release-\1.\2.\3'), # Simple 1:1 character replacements can also be done. The # following transform, which converts backslashes into forward # slashes, should usually be included: ReplaceSubstringsSymbolTransform('\\','/'), # This last rule eliminates leading, trailing, and repeated # slashes within the output symbol names: NormalizePathsSymbolTransform(), ], # See the definition of global_symbol_strategy_rules above for a # description of this option: symbol_strategy_rules=global_symbol_strategy_rules, # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], )
^ permalink raw reply [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 14:58  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Tom Lane @ 2011-10-05 14:58 UTC (permalink / raw)
  To: Marko Kreen <markokr@gmail.com>; +Cc: pgsql-jdbc

Marko Kreen <markokr@gmail.com> writes:
> - There are few manufactured commits on branches (not on HEAD):

> $ grep -i cvs2 cvs2svn-tmp/git-dump.dat
> This commit was manufactured by cvs2git to create branch 'REL6_4'.
> ...

> So the question is does the code look sane around those points
> and do we need to do something with it.  As cvs2git has seen improvements
> since postgres conversion, perhaps they are ok and we can ignore those.
> Especially since they are only on older branches.

I don't have details in my head anymore, but when we did the server's
git conversion, every one of those "manufactured commits" was a real
problem, ie, it didn't represent the history in a nice way.  I think the
most common cause was adding a file on HEAD and then on a pre-existing
branch, and that the unmodified git conversion then misrepresented the
state of the file at earlier instants in that branch (ie, it was there
when it should not be).  This is a bug/ambiguity in the CVS
representation, there is nothing cvs2git can do about it.  We worked
around it in the server conversion by editing the RCS files ... don't
know whether you guys are feeling sufficiently anal to do likewise.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 15:15  Marko Kreen <markokr@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-05 15:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-jdbc

On Wed, Oct 5, 2011 at 4:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Marko Kreen <markokr@gmail.com> writes:
>> - There are few manufactured commits on branches (not on HEAD):
>
>> $ grep -i cvs2 cvs2svn-tmp/git-dump.dat
>> This commit was manufactured by cvs2git to create branch 'REL6_4'.
>> ...
>
>> So the question is does the code look sane around those points
>> and do we need to do something with it.  As cvs2git has seen improvements
>> since postgres conversion, perhaps they are ok and we can ignore those.
>> Especially since they are only on older branches.
>
> I don't have details in my head anymore, but when we did the server's
> git conversion, every one of those "manufactured commits" was a real
> problem, ie, it didn't represent the history in a nice way.  I think the
> most common cause was adding a file on HEAD and then on a pre-existing
> branch, and that the unmodified git conversion then misrepresented the
> state of the file at earlier instants in that branch (ie, it was there
> when it should not be).  This is a bug/ambiguity in the CVS
> representation, there is nothing cvs2git can do about it.  We worked
> around it in the server conversion by editing the RCS files ... don't
> know whether you guys are feeling sufficiently anal to do likewise.

I actually got interfaces/jdbc parts from Magnus' repository_fixups
working against jdbc repo.  Attached script gets rid of two REL7_1 tag
related commits.

But looking at the script it indeed is not about "representing cvs
history in git"
but "working around bad history in cvs".  And it does not affect main branch
history in any way.

So it's dubious whether it's worthwhile to do it, and in any case I'm
wrong person to do it, as I'm completely unfamiliar with JDBC
code, both old and new...

-- 
marko

Attachments:

  repository_fixups (application/octet-stream, 8.2K) download

^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 16:03  Marko Kreen <markokr@gmail.com>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-05 16:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-jdbc

On Wed, Oct 5, 2011 at 5:15 PM, Marko Kreen <markokr@gmail.com> wrote:
> On Wed, Oct 5, 2011 at 4:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Marko Kreen <markokr@gmail.com> writes:
>>> - There are few manufactured commits on branches (not on HEAD):
>>
>>> $ grep -i cvs2 cvs2svn-tmp/git-dump.dat
>>> This commit was manufactured by cvs2git to create branch 'REL6_4'.
>>> ...
>>
>>> So the question is does the code look sane around those points
>>> and do we need to do something with it.  As cvs2git has seen improvements
>>> since postgres conversion, perhaps they are ok and we can ignore those.
>>> Especially since they are only on older branches.
>>
>> I don't have details in my head anymore, but when we did the server's
>> git conversion, every one of those "manufactured commits" was a real
>> problem, ie, it didn't represent the history in a nice way.  I think the
>> most common cause was adding a file on HEAD and then on a pre-existing
>> branch, and that the unmodified git conversion then misrepresented the
>> state of the file at earlier instants in that branch (ie, it was there
>> when it should not be).  This is a bug/ambiguity in the CVS
>> representation, there is nothing cvs2git can do about it.  We worked
>> around it in the server conversion by editing the RCS files ... don't
>> know whether you guys are feeling sufficiently anal to do likewise.
>
> I actually got interfaces/jdbc parts from Magnus' repository_fixups
> working against jdbc repo.  Attached script gets rid of two REL7_1 tag
> related commits.
>
> But looking at the script it indeed is not about "representing cvs
> history in git"
> but "working around bad history in cvs".  And it does not affect main branch
> history in any way.
>
> So it's dubious whether it's worthwhile to do it, and in any case I'm
> wrong person to do it, as I'm completely unfamiliar with JDBC
> code, both old and new...

Another approach:

https://github.com/markokr/pgjdbc-clean

I just added line:

  ExcludeRegexpStrategyRule(r'REL[678].*|WIN32_DEV|release-6-3'),

to config, so that only REL9* branches and tags are converted:

 * [new branch]      REL9_0_STABLE -> REL9_0_STABLE
 * [new branch]      REL9_1_STABLE -> REL9_1_STABLE
 * [new branch]      master -> master
 * [new tag]         REL9_0_801 -> REL9_0_801
 * [new tag]         REL9_0_802 -> REL9_0_802
 * [new tag]         REL9_1_901 -> REL9_1_901

No manufactured commits.

I really suggest going with that approach, otherwise the
conversion will be huge amount of delicate work.
Or broken old branches.

Sanity checking is also easier this way.

If needed the interested people can fix and convert
older branches later.

-- 
marko

Attachments:

c2g.config.py (text/x-python, 27.4K) download # (Be in -*- mode: python; coding: utf-8 -*- mode.) # # ==================================================================== # Copyright (c) 2006-2010 CollabNet. All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://subversion.tigris.org/license-1.html. # If newer versions of this license are posted there, you may use a # newer version instead, at your option. # # This software consists of voluntary contributions made by many # individuals. For exact contribution history, see the revision # history and logs, available at http://cvs2svn.tigris.org/. # ==================================================================== # ##################### # ## PLEASE READ ME! ## # ##################### # # This is a template for an options file that can be used to configure # cvs2svn to convert to git rather than to Subversion. See # www/cvs2git.html and www/cvs2svn.html for general information, and # see the comments in this file for information about what options are # available and how they can be set. # # The program that is run to convert from CVS to git is called # cvs2git. Run it with the --options option, passing it this file # like this: # # cvs2git --options=cvs2git-example.options # # The output of cvs2git is a blob file and a dump file that can be # loaded into git using the "git fast-import" command. Please read # www/cvs2git.html for more information. # # Many options do not have defaults, so it is easier to copy this file # and modify what you need rather than creating a new options file # from scratch. This file is in Python syntax, but you don't need to # know Python to modify it. But if you *do* know Python, then you # will be happy to know that you can use arbitary Python constructs to # do fancy configuration tricks. # # But please be aware of the following: # # * In many places, leading whitespace is significant in Python (it is # used instead of curly braces to group statements together). # Therefore, if you don't know what you are doing, it is best to # leave the whitespace as it is. # # * In normal strings, Python treats a backslash ("\") as an escape # character. Therefore, if you want to specify a string that # contains a backslash, you need either to escape the backslash with # another backslash ("\\"), or use a "raw string", as in one if the # following equivalent examples: # # cvs_executable = 'c:\\windows\\system32\\cvs.exe' # cvs_executable = r'c:\windows\system32\cvs.exe' # # See http://docs.python.org/tutorial/introduction.html#strings for # more information. # # Two identifiers will have been defined before this file is executed, # and can be used freely within this file: # # ctx -- a Ctx object (see cvs2svn_lib/context.py), which holds # many configuration options # # run_options -- an instance of the GitRunOptions class (see # cvs2svn_lib/git_run_options.py), which holds some variables # governing how cvs2git is run # Import some modules that are used in setting the options: import os from cvs2svn_lib import config from cvs2svn_lib import changeset_database from cvs2svn_lib.common import CVSTextDecoder from cvs2svn_lib.log import logger from cvs2svn_lib.git_revision_collector import GitRevisionCollector from cvs2svn_lib.external_blob_generator import ExternalBlobGenerator from cvs2svn_lib.git_output_option import GitRevisionMarkWriter from cvs2svn_lib.git_output_option import GitOutputOption from cvs2svn_lib.dvcs_common import KeywordHandlingPropertySetter from cvs2svn_lib.rcs_revision_manager import RCSRevisionReader from cvs2svn_lib.cvs_revision_manager import CVSRevisionReader from cvs2svn_lib.symbol_strategy import AllBranchRule from cvs2svn_lib.symbol_strategy import AllTagRule from cvs2svn_lib.symbol_strategy import BranchIfCommitsRule from cvs2svn_lib.symbol_strategy import ExcludeRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceBranchRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ForceTagRegexpStrategyRule from cvs2svn_lib.symbol_strategy import ExcludeTrivialImportBranchRule from cvs2svn_lib.symbol_strategy import ExcludeVendorBranchRule from cvs2svn_lib.symbol_strategy import HeuristicStrategyRule from cvs2svn_lib.symbol_strategy import UnambiguousUsageRule from cvs2svn_lib.symbol_strategy import HeuristicPreferredParentRule from cvs2svn_lib.symbol_strategy import SymbolHintsFileRule from cvs2svn_lib.symbol_transform import ReplaceSubstringsSymbolTransform from cvs2svn_lib.symbol_transform import RegexpSymbolTransform from cvs2svn_lib.symbol_transform import IgnoreSymbolTransform from cvs2svn_lib.symbol_transform import NormalizePathsSymbolTransform from cvs2svn_lib.property_setters import AutoPropsPropertySetter from cvs2svn_lib.property_setters import ConditionalPropertySetter from cvs2svn_lib.property_setters import cvs_file_is_binary from cvs2svn_lib.property_setters import CVSBinaryFileDefaultMimeTypeSetter from cvs2svn_lib.property_setters import CVSBinaryFileEOLStyleSetter from cvs2svn_lib.property_setters import DefaultEOLStyleSetter from cvs2svn_lib.property_setters import EOLStyleFromMimeTypeSetter from cvs2svn_lib.property_setters import ExecutablePropertySetter from cvs2svn_lib.property_setters import KeywordsPropertySetter from cvs2svn_lib.property_setters import MimeMapper from cvs2svn_lib.property_setters import SVNBinaryFileKeywordsPropertySetter # To choose the level of logging output, uncomment one of the # following lines: #logger.log_level = logger.WARN #logger.log_level = logger.QUIET logger.log_level = logger.NORMAL #logger.log_level = logger.VERBOSE #logger.log_level = logger.DEBUG # The directory to use for temporary files: ctx.tmpdir = r'cvs2svn-tmp' # During FilterSymbolsPass, cvs2git records the contents of file # revisions into a "blob" file in git-fast-import format. The # ctx.revision_collector option configures that process. Choose one of the two ersions and customize its options. # This first alternative is much slower but is better tested and has a # chance of working with CVSNT repositories. It invokes CVS or RCS to # reconstuct the contents of CVS file revisions: ctx.revision_collector = GitRevisionCollector( # The file in which to write the git-fast-import stream that # contains the file revision contents: 'cvs2svn-tmp/git-blob.dat', # The following option specifies how the revision contents of the # RCS files should be read. # # RCSRevisionReader uses RCS's "co" program to extract the # revision contents of the RCS files during CollectRevsPass. The # constructor argument specifies how to invoke the "co" # executable. # # CVSRevisionReader uses the "cvs" program to extract the revision # contents out of the RCS files during OutputPass. This option is # considerably slower than RCSRevisionReader because "cvs" is # considerably slower than "co". However, it works in some # situations where RCSRevisionReader fails; see the HTML # documentation of the "--use-cvs" option for details. The # constructor argument specifies how to invoke the "co" # executable. # # Uncomment one of the two following lines: #RCSRevisionReader(co_executable=r'co'), CVSRevisionReader(cvs_executable=r'cvs'), ) # This second alternative is vastly faster than the version above. It # uses an external Python program to reconstruct the contents of CVS # file revisions: #ctx.revision_collector = ExternalBlobGenerator('cvs2svn-tmp/git-blob.dat') # cvs2git doesn't need a revision reader because OutputPass only # refers to blobs that were output during CollectRevsPass, so leave # this option set to None. ctx.revision_reader = None # Change the following line to True if the conversion should only # include the trunk of the repository (i.e., all branches and tags # should be omitted from the conversion): ctx.trunk_only = False # How to convert CVS author names, log messages, and filenames to # Unicode. The first argument to CVSTextDecoder is a list of encoders # that are tried in order in 'strict' mode until one of them succeeds. # If none of those succeeds, then fallback_encoder (if it is # specified) is used in lossy 'replace' mode. Setting a fallback # encoder ensures that the encoder always succeeds, but it can cause # information loss. ctx.cvs_author_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) ctx.cvs_log_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii', eol_fix='\n', ) # You might want to be especially strict when converting filenames to # Unicode (e.g., maybe not specify a fallback_encoding). ctx.cvs_filename_decoder = CVSTextDecoder( [ 'utf8', 'latin1', 'ascii', ], #fallback_encoding='ascii' ) # Template for the commit message to be used for initial project # commits. ctx.initial_project_commit_message = ( 'Standard project directories initialized by cvs2git.' ) # Template for the commit message to be used for post commits, in # which modifications to a vendor branch are copied back to trunk. # This message can use '%(revnum)d' to include the SVN revision number # of the revision that included the change to the vendor branch # (admittedly rather pointless in a cvs2git conversion). ctx.post_commit_message = ( 'This commit was generated by cvs2git to track changes on a CVS ' 'vendor branch.' ) # Template for the commit message to be used for commits in which # symbols are created. This message can use '%(symbol_type)s' to # include the type of the symbol ('branch' or 'tag') or # '%(symbol_name)s' to include the name of the symbol. ctx.symbol_commit_message = ( "This commit was manufactured by cvs2git to create %(symbol_type)s " "'%(symbol_name)s'." ) # Template for the commit message to be used for commits in which # tags are pseudo-merged back to their source branch. This message can # use '%(symbol_name)s' to include the name of the symbol. # (Not used by default unless you enable tie_tag_fixup_branches on # GitOutputOption.) ctx.tie_tag_ancestry_message = ( "This commit was manufactured by cvs2git to tie ancestry for " "tag '%(symbol_name)s' back to the source branch." ) # Some CVS clients for MacOS store resource fork data into CVS along # with the file contents itself by wrapping it all up in a container # format called "AppleSingle". Subversion currently does not support # MacOS resource forks. Nevertheless, sometimes the resource fork # information is not necessary and can be discarded. Set the # following option to True if you would like cvs2svn to identify files # whose contents are encoded in AppleSingle format, and discard all # but the data fork for such files before committing them to # Subversion. (Please note that AppleSingle contents are identified # by the AppleSingle magic number as the first four bytes of the file. # This check is not failproof, so only set this option if you think # you need it.) ctx.decode_apple_single = False # This option can be set to the name of a filename to which are stored # statistics and conversion decisions about the CVS symbols. ctx.symbol_info_filename = None #ctx.symbol_info_filename = 'symbol-info.txt' # cvs2svn uses "symbol strategy rules" to help decide how to handle # CVS symbols. The rules in a project's symbol_strategy_rules are # applied in order, and each rule is allowed to modify the symbol. # The result (after each of the rules has been applied) is used for # the conversion. # # 1. A CVS symbol might be used as a tag in one file and as a branch # in another file. cvs2svn has to decide whether to convert such a # symbol as a tag or as a branch. cvs2svn uses a series of # heuristic rules to decide how to convert a symbol. The user can # override the default rules for specific symbols or symbols # matching regular expressions. # # 2. cvs2svn is also capable of excluding symbols from the conversion # (provided no other symbols depend on them. # # 3. CVS does not record unambiguously the line of development from # which a symbol sprouted. cvs2svn uses a heuristic to choose a # symbol's "preferred parents". # # The standard branch/tag/exclude StrategyRules do not change a symbol # that has already been processed by an earlier rule, so in effect the # first matching rule is the one that is used. global_symbol_strategy_rules = [ # It is possible to specify manually exactly how symbols should be # converted and what line of development should be used as the # preferred parent. To do so, create a file containing the symbol # hints and enable the following option. # # The format of the hints file is described in the documentation # for the --symbol-hints command-line option. The file output by # the --write-symbol-info (i.e., ctx.symbol_info_filename) option # is in the same format. The simplest way to use this option is # to run the conversion through CollateSymbolsPass with # --write-symbol-info option, copy the symbol info and edit it to # create a hints file, then re-start the conversion at # CollateSymbolsPass with this option enabled. #SymbolHintsFileRule('symbol-hints.txt'), # To force all symbols matching a regular expression to be # converted as branches, add rules like the following: #ForceBranchRegexpStrategyRule(r'branch.*'), # To force all symbols matching a regular expression to be # converted as tags, add rules like the following: #ForceTagRegexpStrategyRule(r'tag.*'), # To force all symbols matching a regular expression to be # excluded from the conversion, add rules like the following: #ExcludeRegexpStrategyRule(r'unknown-.*'), # Sometimes people use "cvs import" to get their own source code # into CVS. This practice creates a vendor branch 1.1.1 and # imports the code onto the vendor branch as 1.1.1.1, then copies # the same content to the trunk as version 1.1. Normally, such # vendor branches are useless and they complicate the SVN history # unnecessarily. The following rule excludes any branches that # only existed as a vendor branch with a single import (leaving # only the 1.1 revision). If you want to retain such branches, # comment out the following line. (Please note that this rule # does not exclude vendor *tags*, as they are not so easy to # identify.) ExcludeTrivialImportBranchRule(), # To exclude all vendor branches (branches that had "cvs import"s # on them but no other kinds of commits), uncomment the following # line: #ExcludeVendorBranchRule(), # Usually you want this rule, to convert unambiguous symbols # (symbols that were only ever used as tags or only ever used as # branches in CVS) the same way they were used in CVS: UnambiguousUsageRule(), # If there was ever a commit on a symbol, then it cannot be # converted as a tag. This rule causes all such symbols to be # converted as branches. If you would like to resolve such # ambiguities manually, comment out the following line: BranchIfCommitsRule(), # Last in the list can be a catch-all rule that is used for # symbols that were not matched by any of the more specific rules # above. (Assuming that BranchIfCommitsRule() was included above, # then the symbols that are still indeterminate at this point can # sensibly be converted as branches or tags.) Include at most one # of these lines. If none of these catch-all rules are included, # then the presence of any ambiguous symbols (that haven't been # disambiguated above) is an error: # Convert ambiguous symbols based on whether they were used more # often as branches or as tags: HeuristicStrategyRule(), # Convert all ambiguous symbols as branches: #AllBranchRule(), # Convert all ambiguous symbols as tags: #AllTagRule(), # The last rule is here to choose the preferred parent of branches # and tags, that is, the line of development from which the symbol # sprouts. HeuristicPreferredParentRule(), ] # Specify a username to be used for commits for which CVS doesn't # record the original author (for example, the creation of a branch). # This should be a simple (unix-style) username, but it can be # translated into a git-style name by the author_transforms map. ctx.username = 'cvs2git' # ctx.file_property_setters and ctx.revision_property_setters contain # rules used to set the svn properties on files in the converted # archive. For each file, the rules are tried one by one. Any rule # can add or suppress one or more svn properties. Typically the rules # will not overwrite properties set by a previous rule (though they # are free to do so). ctx.file_property_setters should be used for # properties that remain the same for the life of the file; these # should implement FilePropertySetter. ctx.revision_property_setters # should be used for properties that are allowed to vary from revision # to revision; these should implement RevisionPropertySetter. # # Obviously, SVN properties per se are not interesting for a cvs2git # conversion, but some of these properties have side-effects that do # affect the git output. FIXME: Document this in more detail. ctx.file_property_setters.extend([ # To read auto-props rules from a file, uncomment the following line # and specify a filename. The boolean argument specifies whether # case should be ignored when matching filenames to the filename # patterns found in the auto-props file: #AutoPropsPropertySetter( # r'/home/username/.subversion/config', # ignore_case=True, # ), # To read mime types from a file and use them to set svn:mime-type # based on the filename extensions, uncomment the following line # and specify a filename (see # http://en.wikipedia.org/wiki/Mime.types for information about # mime.types files): #MimeMapper(r'/etc/mime.types', ignore_case=False), # Omit the svn:eol-style property from any files that are listed # as binary (i.e., mode '-kb') in CVS: CVSBinaryFileEOLStyleSetter(), # If the file is binary and its svn:mime-type property is not yet # set, set svn:mime-type to 'application/octet-stream'. CVSBinaryFileDefaultMimeTypeSetter(), # To try to determine the eol-style from the mime type, uncomment # the following line: #EOLStyleFromMimeTypeSetter(), # Choose one of the following lines to set the default # svn:eol-style if none of the above rules applied. The argument # is the svn:eol-style that should be applied, or None if no # svn:eol-style should be set (i.e., the file should be treated as # binary). # # The default is to treat all files as binary unless one of the # previous rules has determined otherwise, because this is the # safest approach. However, if you have been diligent about # marking binary files with -kb in CVS and/or you have used the # above rules to definitely mark binary files as binary, then you # might prefer to use 'native' as the default, as it is usually # the most convenient setting for text files. Other possible # options: 'CRLF', 'CR', 'LF'. DefaultEOLStyleSetter(None), #DefaultEOLStyleSetter('native'), # Prevent svn:keywords from being set on files that have # svn:eol-style unset. SVNBinaryFileKeywordsPropertySetter(), # If svn:keywords has not been set yet, set it based on the file's # CVS mode: KeywordsPropertySetter(config.SVN_KEYWORDS_VALUE), # Set the svn:executable flag on any files that are marked in CVS as # being executable: ExecutablePropertySetter(), # The following causes keywords to be untouched in binary files and # collapsed in all text to be committed: ConditionalPropertySetter( cvs_file_is_binary, KeywordHandlingPropertySetter('untouched'), ), KeywordHandlingPropertySetter('collapsed'), ]) ctx.revision_property_setters.extend([ ]) # To skip the cleanup of temporary files, uncomment the following # option: #ctx.skip_cleanup = True # In CVS, it is perfectly possible to make a single commit that # affects more than one project or more than one branch of a single # project. Subversion also allows such commits. Therefore, by # default, when cvs2svn sees what looks like a cross-project or # cross-branch CVS commit, it converts it into a # cross-project/cross-branch Subversion commit. # # However, other tools and SCMs have trouble representing # cross-project or cross-branch commits. (For example, Trac's Revtree # plugin, http://www.trac-hacks.org/wiki/RevtreePlugin is confused by # such commits.) Therefore, we provide the following two options to # allow cross-project/cross-branch commits to be suppressed. # cvs2git only supports single-project conversions (multiple-project # conversions wouldn't really make sense for git anyway). So this # option must be set to False: ctx.cross_project_commits = False # git itself doesn't allow commits that affect more than one branch, # so this option must be set to False: ctx.cross_branch_commits = False # cvs2git does not yet handle translating .cvsignore files into # .gitignore files, so by default, the .cvsignore files are included # in the conversion output. If you would like to omit the .cvsignore # files from the output, set this option to False: ctx.keep_cvsignore = True # By default, it is a fatal error for a CVS ",v" file to appear both # inside and outside of an "Attic" subdirectory (this should never # happen, but frequently occurs due to botched repository # administration). If you would like to retain both versions of such # files, change the following option to True, and the attic version of # the file will be written to a subdirectory called "Attic" in the # output repository: ctx.retain_conflicting_attic_files = False # CVS uses unix login names as author names whereas git requires # author names to be of the form "foo <bar>". The default is to set # the git author to "cvsauthor <cvsauthor>". author_transforms can be # used to map cvsauthor names (e.g., "jrandom") to a true name and # email address (e.g., "J. Random <jrandom@example.com>" for the # example shown). All strings should be either Unicode strings (i.e., # with "u" as a prefix) or 8-bit strings in the utf-8 encoding. The # values can either be strings in the form "name <email>" or tuples # (name, email). Please substitute your own project's usernames here # to use with the author_transforms option of GitOutputOption below. author_transforms={ 'barry' : ('Barry Lind', 'barry@xythos.com'), 'blind' : ('Barry Lind', 'barry@xythos.com'), 'cvs2git': ('CVS to git conversion script', 'webmaster@postgresql.org'), 'davec' : ('Dave Cramer', 'davec@fastcrypt.com'), 'davecramer' : ('Dave Cramer', 'davec@fastcrypt.com'), 'jurka' : ('Kris Jurka', 'books@ejurka.com'), 'momjian' : ('Bruce Momjian', 'bruce@momjian.us'), 'oliver': ('Oliver Jowett', 'oliver@opencloud.com'), 'peter' : ('Peter Mount', 'peter@retep.org.uk'), 'petere' : ('Peter Eisentraut', 'peter_e@gmx.net'), 'pgsql' : ('PostgreSQL Daemon', 'webmaster@postgresql.org'), 'scrappy' : ('Marc G. Fournier', 'scrappy@hub.org'), 'tgl' : ('Tom Lane', 'tgl@sss.pgh.pa.us'), 'thomas' : ('Thomas G. Lockhart', 'lockhart@fourpalms.org'), 'wieck' : ('Jan Wieck', 'JanWieck@Yahoo.com'), } # This is the main option that causes cvs2svn to output to a # "fastimport"-format dumpfile rather than to Subversion: ctx.output_option = GitOutputOption( # The file in which to write the git-fast-import stream that # contains the changesets and branch/tag information: os.path.join(ctx.tmpdir, 'git-dump.dat'), # The blobs will be written via the revision recorder, so in # OutputPass we only have to emit references to the blob marks: GitRevisionMarkWriter(), # Optional map from CVS author names to git author names: author_transforms=author_transforms, ) # Change this option to True to turn on profiling of cvs2svn (for # debugging purposes): run_options.profiling = False # Should CVSItem -> Changeset database files be memory mapped? In # some tests, using memory mapping speeded up the overall conversion # by about 5%. But this option can cause the conversion to fail with # an out of memory error if the conversion computer runs out of # virtual address space (e.g., when running a very large conversion on # a 32-bit operating system). Therefore it is disabled by default. # Uncomment the following line to allow these database files to be # memory mapped. #changeset_database.use_mmap_for_cvs_item_to_changeset_table = True # Now set the project to be converted to git. cvs2git only supports # single-project conversions, so this method must only be called # once: run_options.set_project( # The filesystem path to the part of the CVS repository (*not* a # CVS working copy) that should be converted. This may be a # subdirectory (i.e., a module) within a larger CVS repository. r'pgjdbc.fixed', # A list of symbol transformations that can be used to rename # symbols in this project. symbol_transforms=[ # Use IgnoreSymbolTransforms like the following to completely # ignore symbols matching a regular expression when parsing # the CVS repository, for example to avoid warnings about # branches with two names and to choose the preferred name. # It is *not* recommended to use this instead of # ExcludeRegexpStrategyRule; though more efficient, # IgnoreSymbolTransforms are less flexible and don't exclude # branches correctly. The argument is a Python-style regular # expression that has to match the *whole* CVS symbol name: #IgnoreSymbolTransform(r'nightly-build-tag-.*') # RegexpSymbolTransforms transform symbols textually using a # regular expression. The first argument is a Python regular # expression pattern and the second is a replacement pattern. # The pattern is matched against each symbol name. If it # matches the whole symbol name, then the symbol name is # replaced with the corresponding replacement text. The # replacement can include substitution patterns (e.g., r'\1' # or r'\g<name>'). Typically you will want to use raw strings # (strings with a preceding 'r', like shown in the examples) # for the regexp and its replacement to avoid backslash # substitution within those strings. #RegexpSymbolTransform(r'release-(\d+)_(\d+)', # r'release-\1.\2'), #RegexpSymbolTransform(r'release-(\d+)_(\d+)_(\d+)', # r'release-\1.\2.\3'), # Simple 1:1 character replacements can also be done. The # following transform, which converts backslashes into forward # slashes, should usually be included: ReplaceSubstringsSymbolTransform('\\','/'), # This last rule eliminates leading, trailing, and repeated # slashes within the output symbol names: NormalizePathsSymbolTransform(), ], # See the definition of global_symbol_strategy_rules above for a # description of this option: symbol_strategy_rules=global_symbol_strategy_rules, # Exclude paths from the conversion. Should be relative to # repository path and use forward slashes: #exclude_paths=['file-to-exclude.txt,v', 'dir/to/exclude'], )
^ permalink raw reply [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 16:07  Kris Jurka <books@ejurka.com>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Kris Jurka @ 2011-10-05 16:07 UTC (permalink / raw)
  To: Marko Kreen <markokr@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

On 10/5/2011 9:03 AM, Marko Kreen wrote:

> I just added line:
>
>    ExcludeRegexpStrategyRule(r'REL[678].*|WIN32_DEV|release-6-3'),
>
> to config, so that only REL9* branches and tags are converted:

That's not going to do it.  We need the old branches and tags preserved.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-05 16:10  Marko Kreen <markokr@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-05 16:10 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

On Wed, Oct 5, 2011 at 6:07 PM, Kris Jurka <books@ejurka.com> wrote:
> On 10/5/2011 9:03 AM, Marko Kreen wrote:
>> I just added line:
>>
>>   ExcludeRegexpStrategyRule(r'REL[678].*|WIN32_DEV|release-6-3'),
>>
>> to config, so that only REL9* branches and tags are converted:
>
> That's not going to do it.  We need the old branches and tags preserved.

Well, they *are* preserved, in cvs repo :)

But it's up to you to decide your requirements.

-- 
marko



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-06 07:48  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-10-06 07:48 UTC (permalink / raw)
  To: Marko Kreen <markokr@gmail.com>; +Cc: Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

If anyone is interested, I've created a github repo for the conversion
and included Marko's scripts so far:

https://github.com/deafbybeheading/pgjdbc2git/

It may be helpful to tracks what works and what doesn't in various attempts.

I did not include the lopping off of pre-9 branches, since that's not
an acceptable trade-off.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-10-06 08:13  Marko Kreen <markokr@gmail.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-10-06 08:13 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

On Thu, Oct 6, 2011 at 9:48 AM, Maciek Sakrejda <msakrejda@truviso.com> wrote:
> If anyone is interested, I've created a github repo for the conversion
> and included Marko's scripts so far:
>
> https://github.com/deafbybeheading/pgjdbc2git/
>
> It may be helpful to tracks what works and what doesn't in various attempts.
>
> I did not include the lopping off of pre-9 branches, since that's not
> an acceptable trade-off.

Cool, thanks for doing it.

I propose following patch to it:
- include commented-out line for dropping branches, then all my hacks
will be there.
- comment out pushing
- show how to create pgjdbc.fixed
- grep for manufactured commits
- change scripts to be executable

Also I suggest removing the .diff, its pointless.

-- 
marko

Attachments:

fixes.diff (text/x-diff, 1.4K) download diff --git a/c2g.config.py b/c2g.config.py index 7ff4598..1ad3b4f 100644 --- a/c2g.config.py +++ b/c2g.config.py @@ -314,6 +314,9 @@ global_symbol_strategy_rules = [ # excluded from the conversion, add rules like the following: #ExcludeRegexpStrategyRule(r'unknown-.*'), + # pgjdbc: ignore pre-9.x branches + #ExcludeRegexpStrategyRule(r'REL[678].*|WIN32_DEV|release-6-3'), + # Sometimes people use "cvs import" to get their own source code # into CVS. This practice creates a vendor branch 1.1.1 and # imports the code onto the vendor branch as 1.1.1.1, then copies diff --git a/convert.sh b/convert.sh old mode 100644 new mode 100755 index e4a0346..4de2bc4 --- a/convert.sh +++ b/convert.sh @@ -7,9 +7,13 @@ dst=git@github.com:markokr/pgjdbc-test.git rsync -avz --delete $repo/pgjdbc . -rm -rf cvs2svn-tmp pgjdbc.git +rm -rf cvs2svn-tmp pgjdbc.git pgjdbc.fixed mkdir -p cvs2svn-tmp pgjdbc.git +# either patch or not +cp -a pgjdbc pgjdbc.fixed +#sh ./repository_fixups + $c2g --options=c2g.config.py # create repo @@ -23,7 +27,10 @@ git repack -a -d -f # checkout source git checkout master +# find manufactured commits +grep -i cvs2 ../cvs2svn-tmp/git-dump.dat + # push somewhere -git remote add dst $dst -git push -f --mirror dst +#git remote add dst $dst +#git push -f --mirror dst diff --git a/repository_fixups b/repository_fixups old mode 100644 new mode 100755
^ permalink raw reply [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:04  Dave Cramer <pg@fastcrypt.com>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Dave Cramer @ 2011-12-06 21:04 UTC (permalink / raw)
  To: Marko Kreen <markokr@gmail.com>; +Cc: Maciek Sakrejda <msakrejda@truviso.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

Ok, I've had a crack at this. I have a local copy on github
git://github.com/davecramer/pgjdbc.git . How can I clone the github
copy to git.postgresql.org ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Thu, Oct 6, 2011 at 4:13 AM, Marko Kreen <markokr@gmail.com> wrote:
> On Thu, Oct 6, 2011 at 9:48 AM, Maciek Sakrejda <msakrejda@truviso.com> wrote:
>> If anyone is interested, I've created a github repo for the conversion
>> and included Marko's scripts so far:
>>
>> https://github.com/deafbybeheading/pgjdbc2git/
>>
>> It may be helpful to tracks what works and what doesn't in various attempts.
>>
>> I did not include the lopping off of pre-9 branches, since that's not
>> an acceptable trade-off.
>
> Cool, thanks for doing it.
>
> I propose following patch to it:
> - include commented-out line for dropping branches, then all my hacks
> will be there.
> - comment out pushing
> - show how to create pgjdbc.fixed
> - grep for manufactured commits
> - change scripts to be executable
>
> Also I suggest removing the .diff, its pointless.
>
> --
> marko
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:23  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 3 replies; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-06 21:23 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Marko Kreen <markokr@gmail.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

> Ok, I've had a crack at this. I have a local copy on github
> git://github.com/davecramer/pgjdbc.git . How can I clone the github
> copy to git.postgresql.org ?

Excellent. Before we do that, though, should we try to clean up the
cvs2svn manufactured commits on branches with git filter-branch? I've
been meaning to get back to this, but now that someone's taken the
initiative, I can give that a shot tonight. Also, is the author info
right?:

maciek@anemone:~$ git log | grep 'Author:' | sort | uniq
Author: barry <barry>
Author: blind <blind>
Author: davec <davec>
Author: davecramer <davecramer>
Author: jurka <jurka>
Author: momjian <momjian>
Author: oliver <oliver>
Author: petere <petere>
Author: peter <peter>
Author: pgsql <pgsql>
Author: scrappy <scrappy>
Author: tgl <tgl>
Author: wieck <wieck>

It does not include e-mail addresses (I don't know if we necessarily
need them, but, e.g., the main PostgreSQL repo seems to have them) and
it seems to dupe some committers with aliases (davec/davecramer and
possibly petere/peter? also, should the "pgsql" commmits be attributed
to someone?). The filter-branch (or another filter-branch) can take
care of this as well.

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:26  Dave Cramer <pg@fastcrypt.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  2 siblings, 1 reply; 32+ messages in thread

From: Dave Cramer @ 2011-12-06 21:26 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Marko Kreen <markokr@gmail.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Tue, Dec 6, 2011 at 4:23 PM, Maciek Sakrejda <msakrejda@truviso.com> wrote:
>> Ok, I've had a crack at this. I have a local copy on github
>> git://github.com/davecramer/pgjdbc.git . How can I clone the github
>> copy to git.postgresql.org ?
>
> Excellent. Before we do that, though, should we try to clean up the
> cvs2svn manufactured commits on branches with git filter-branch? I've
> been meaning to get back to this, but now that someone's taken the
> initiative, I can give that a shot tonight. Also, is the author info
> right?:
>
> maciek@anemone:~$ git log | grep 'Author:' | sort | uniq

barry, and blind are the same person
> Author: barry <barry>
> Author: blind <blind>
davec and davecramer are the same person ( me)
> Author: davec <davec>
> Author: davecramer <davecramer>
> Author: jurka <jurka>
> Author: momjian <momjian>
> Author: oliver <oliver>
petere and peter could well be two different ppl.
> Author: petere <petere>
> Author: peter <peter>
no idea who pgsql is ?
> Author: pgsql <pgsql>
> Author: scrappy <scrappy>
> Author: tgl <tgl>
> Author: wieck <wieck>
>
> It does not include e-mail addresses (I don't know if we necessarily
> need them, but, e.g., the main PostgreSQL repo seems to have them) and
> it seems to dupe some committers with aliases (davec/davecramer and
> possibly petere/peter? also, should the "pgsql" commmits be attributed
> to someone?). The filter-branch (or another filter-branch) can take
> care of this as well.
>
> Thanks,
> ---
> Maciek Sakrejda | System Architect | Truviso
>
> 1065 E. Hillsdale Blvd., Suite 215
> Foster City, CA 94404
> (650) 242-3500 Main
> www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:28  Dave Cramer <pg@fastcrypt.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  2 siblings, 1 reply; 32+ messages in thread

From: Dave Cramer @ 2011-12-06 21:28 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Marko Kreen <markokr@gmail.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

Sorry, missed the fact that you had a question in there.

Yes if we can clean up the manufactured commits that would be good.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Tue, Dec 6, 2011 at 4:23 PM, Maciek Sakrejda <msakrejda@truviso.com> wrote:
>> Ok, I've had a crack at this. I have a local copy on github
>> git://github.com/davecramer/pgjdbc.git . How can I clone the github
>> copy to git.postgresql.org ?
>
> Excellent. Before we do that, though, should we try to clean up the
> cvs2svn manufactured commits on branches with git filter-branch? I've
> been meaning to get back to this, but now that someone's taken the
> initiative, I can give that a shot tonight. Also, is the author info
> right?:
>
> maciek@anemone:~$ git log | grep 'Author:' | sort | uniq
> Author: barry <barry>
> Author: blind <blind>
> Author: davec <davec>
> Author: davecramer <davecramer>
> Author: jurka <jurka>
> Author: momjian <momjian>
> Author: oliver <oliver>
> Author: petere <petere>
> Author: peter <peter>
> Author: pgsql <pgsql>
> Author: scrappy <scrappy>
> Author: tgl <tgl>
> Author: wieck <wieck>
>
> It does not include e-mail addresses (I don't know if we necessarily
> need them, but, e.g., the main PostgreSQL repo seems to have them) and
> it seems to dupe some committers with aliases (davec/davecramer and
> possibly petere/peter? also, should the "pgsql" commmits be attributed
> to someone?). The filter-branch (or another filter-branch) can take
> care of this as well.
>
> Thanks,
> ---
> Maciek Sakrejda | System Architect | Truviso
>
> 1065 E. Hillsdale Blvd., Suite 215
> Foster City, CA 94404
> (650) 242-3500 Main
> www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:34  Marko Kreen <markokr@gmail.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  2 siblings, 1 reply; 32+ messages in thread

From: Marko Kreen @ 2011-12-06 21:34 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

On Tue, Dec 6, 2011 at 11:23 PM, Maciek Sakrejda <msakrejda@truviso.com> wrote:
>> Ok, I've had a crack at this. I have a local copy on github
>> git://github.com/davecramer/pgjdbc.git . How can I clone the github
>> copy to git.postgresql.org ?
>
> Excellent. Before we do that, though, should we try to clean up the
> cvs2svn manufactured commits on branches with git filter-branch? I've
> been meaning to get back to this, but now that someone's taken the
> initiative, I can give that a shot tonight. Also, is the author info
> right?:

The manufactured commit means cvs2git has lost sync with repo
and uses such commit to get back on track.  Can you really
simply filter out such commits, without fixing the sync problem first?

Instead, if the surrounding commits look fine, you can leave them as-is.

> maciek@anemone:~$ git log | grep 'Author:' | sort | uniq
> Author: barry <barry>
> Author: blind <blind>
> Author: davec <davec>
> Author: davecramer <davecramer>
> Author: jurka <jurka>
> Author: momjian <momjian>
> Author: oliver <oliver>
> Author: petere <petere>
> Author: peter <peter>
> Author: pgsql <pgsql>
> Author: scrappy <scrappy>
> Author: tgl <tgl>
> Author: wieck <wieck>
>
> It does not include e-mail addresses (I don't know if we necessarily
> need them, but, e.g., the main PostgreSQL repo seems to have them) and
> it seems to dupe some committers with aliases (davec/davecramer and
> possibly petere/peter? also, should the "pgsql" commmits be attributed
> to someone?). The filter-branch (or another filter-branch) can take
> care of this as well.

This file should have good author list:

https://github.com/mhagander/pggit_migrate/blob/master/cvs2git.options

-- 
marko



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:38  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 32+ messages in thread

From: Tom Lane @ 2011-12-06 21:38 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Maciek Sakrejda <msakrejda@truviso.com>; Marko Kreen <markokr@gmail.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Dave Cramer <pg@fastcrypt.com> writes:
> petere and peter could well be two different ppl.
>> Author: petere <petere>
>> Author: peter <peter>

petere would be Peter Eisentraut, the other is Peter Mount, I believe.

> no idea who pgsql is ?
>> Author: pgsql <pgsql>
>> Author: scrappy <scrappy>

Both of those are Marc Fournier --- Marc sometimes committed from the
pgsql user account, but I don't think anybody else ever did.

For consistency's sake I'd suggest you use the same spellings used in
the core repository conversion, which are

Alvaro Herrera <alvherre@alvh.no-ip.org>
Andrew Dunstan <andrew@dunslane.net>
Barry Lind <barry@xythos.com>
Bruce Momjian <bruce@momjian.us>
Bryan Henderson <bryanh@giraffe.netgate.net>
Byron Nikolaidis <byronn@insightdist.com>
CVS to git conversion script <webmaster@postgresql.org>
D'Arcy J.M. Cain <darcy@druid.net>
Dave Cramer <davec@fastcrypt.com>
Dennis Bjorklund <db@zigo.dhs.org>
Edmund Mergl <E.Mergl@bawue.de>
Greg Stark <stark@mit.edu>
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Hiroshi Inoue <inoue@tpf.co.jp>
Itagaki Takahiro <itagaki.takahiro@gmail.com>
Jan Wieck <JanWieck@Yahoo.com>
Joe Conway <mail@joeconway.com>
Julian Assange <proff@suburbia.net>
Kris Jurka <books@ejurka.com>
Magnus Hagander <magnus@hagander.net>
Marc G. Fournier <scrappy@hub.org>
Michael Meskes <meskes@postgresql.org>
Neil Conway <neilc@samurai.com>
Peter Eisentraut <peter_e@gmx.net>
Peter Mount <peter@retep.org.uk>
Philip Warner <pjw@rhyme.com.au>
PostgreSQL Daemon <webmaster@postgresql.org>
Robert Haas <rhaas@postgresql.org>
Simon Riggs <simon@2ndQuadrant.com>
Tatsuo Ishii <ishii@postgresql.org>
Teodor Sigaev <teodor@sigaev.ru>
Thomas G. Lockhart <lockhart@fourpalms.org>
Tom Lane <tgl@sss.pgh.pa.us>
Vadim B. Mikheev <vadim4o@yahoo.com>
Vince Vielhaber <vev@michvhf.com>

although if any of the current JDBC committers prefer other email
addresses, there's probably no harm in adjusting those.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:39  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-06 21:39 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Marko Kreen <markokr@gmail.com>; Kris Jurka <books@ejurka.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-jdbc

Okay, based on some quick log digging, I *think* "petere" is Peter
Eisentraut and "peter" is Peter Mount. I'll reference the list Marko
just sent out and the core PostgreSQL repo logs for any other author
information. I'll clean up the authors and remove the manufactured
commits. As to the "synch" concerns, I'll spot-check as I do this and
we can investigate further. I'll script this so we can refine/redo it
if necessary.
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-06 21:45  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Marko Kreen <markokr@gmail.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Tom Lane @ 2011-12-06 21:45 UTC (permalink / raw)
  To: Marko Kreen <markokr@gmail.com>; +Cc: Maciek Sakrejda <msakrejda@truviso.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Marko Kreen <markokr@gmail.com> writes:
> The manufactured commit means cvs2git has lost sync with repo
> and uses such commit to get back on track.  Can you really
> simply filter out such commits, without fixing the sync problem first?

When we did the core conversion, all the "manufactured" commits turned
out to be due to problems in the CVS repository, and we fixed them by
tweaking the repository contents before running the conversion.  There's
lots of detail in the pgsql-hackers archives.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-07 04:32  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-07 04:32 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

> When we did the core conversion, all the "manufactured" commits turned
> out to be due to problems in the CVS repository, and we fixed them by
> tweaking the repository contents before running the conversion.  There's
> lots of detail in the pgsql-hackers archives.

Kris had pointed out something like this, too. I had looked at the
most recent few manufactured commits and didn't see any problems
(i.e., they were empty and could simply have been filtered out), but I
investigated further and you're absolutely right: starting shortly
before the 8.2-508 tag (and all the way back to the beginning), there
are some bogus commits leading to a weird history: e.g.,
https://github.com/davecramer/pgjdbc/commit/266a282e221a33e6e5f52f5388ea739528267f70
. It's hard to see this without a visualizer like gitk, but that
commit has two parents, merging the master branch into what it claims
is the newly-created 8.2 branch (which in fact has been around for a
while by that point, as evidenced by all the 8.2.x tags). This sort of
thing seems to happen over and over. I can't quite follow what it's
doing (or the mailing list explanations I've found, for that matter),
possibly since I have extremely limited experience with CVS (and I
thank my lucky stars for that). I also tried with a newer cvs2git, but
no dice.

I think if we care about history, moving forward with the migration
without resolving this would be a mistake. I'll pore over the core
list history on this and see what I can see. Advice from anyone with
CVS background welcome--e.g., are there any (Linux, ideally, but
Windows works) tools for visualizing CVS history (like gitk for git?).
Does TortoiseCVS support that (I vaguely recall that TortoiseSVN
does)?

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-07 07:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Tom Lane @ 2011-12-07 07:25 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Maciek Sakrejda <msakrejda@truviso.com> writes:
> Kris had pointed out something like this, too. I had looked at the
> most recent few manufactured commits and didn't see any problems
> (i.e., they were empty and could simply have been filtered out), but I
> investigated further and you're absolutely right: starting shortly
> before the 8.2-508 tag (and all the way back to the beginning), there
> are some bogus commits leading to a weird history: e.g.,
> https://github.com/davecramer/pgjdbc/commit/266a282e221a33e6e5f52f5388ea739528267f70
> . It's hard to see this without a visualizer like gitk, but that
> commit has two parents, merging the master branch into what it claims
> is the newly-created 8.2 branch (which in fact has been around for a
> while by that point, as evidenced by all the 8.2.x tags). This sort of
> thing seems to happen over and over. I can't quite follow what it's
> doing (or the mailing list explanations I've found, for that matter),
> possibly since I have extremely limited experience with CVS (and I
> thank my lucky stars for that). I also tried with a newer cvs2git, but
> no dice.

Many of the problems in the core conversion stemmed from the weird way
in which CVS deals with files that are added to branches later than they
are added to mainline.  Originally, CVS had no way to represent the fact
that such a file had not existed on the branch all the way back to the
time of its addition to mainline; although any tags you'd added to the
branch in between would not be on such a file, making it apparent that
it wasn't really there.  So cvs2git sees an inconsistent history and has
to do something ugly to fix it.

Later on, the CVS people invented a kluge way to represent this situation,
so it's possible that you don't have any such cases in recent history.
Basically the kluge requires inserting a deletion event on the branch at
the time of the file's creation on master.  We did that by hand-editing
the RCS files when we did the core conversion, which was a tad more
exciting than I would've liked, but there weren't really enough cases
to justify building a tool for it.

There were also assorted problems stemming from having done squirrelly
things back in the day, like moving the point from which the REL7_1
branch had been sprouted.  I'm not clear on how much of that might
affect the JDBC repository.

There's lots and lots of detail in the pgsql-hackers archives about
this, around mid September 2010.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-08 01:33  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-08 01:33 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Thanks, this is extremely helpful.

> Many of the problems in the core conversion stemmed from the weird way
> in which CVS deals with files that are added to branches later than they
> are added to mainline.

You mean something like branch REL_X_STABLE created, file A added to
trunk, some more commits to trunk, then eventually the addition of A
back-ported to REL_X_STABLE?

> Originally, CVS had no way to represent the fact
> that such a file had not existed on the branch all the way back to the
> time of its addition to mainline; although any tags you'd added to the
> branch in between would not be on such a file, making it apparent that
> it wasn't really there.  So cvs2git sees an inconsistent history and has
> to do something ugly to fix it.
>
> Later on, the CVS people invented a kluge way to represent this situation,
> so it's possible that you don't have any such cases in recent history.
> Basically the kluge requires inserting a deletion event on the branch at
> the time of the file's creation on master.  We did that by hand-editing
> the RCS files when we did the core conversion, which was a tad more
> exciting than I would've liked, but there weren't really enough cases
> to justify building a tool for it.

Okay, I'll dig into the RCS files from the dump Kris and sent out and
compare the (well-migrated) recent branches to the older branches
which show problems. I'm not one to shy away from excitement.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-08 02:16  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Tom Lane @ 2011-12-08 02:16 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Maciek Sakrejda <msakrejda@truviso.com> writes:
>> Many of the problems in the core conversion stemmed from the weird way
>> in which CVS deals with files that are added to branches later than they
>> are added to mainline.

> You mean something like branch REL_X_STABLE created, file A added to
> trunk, some more commits to trunk, then eventually the addition of A
> back-ported to REL_X_STABLE?

Yeah, except it's not the other activity on trunk that's interesting,
it's the other activity on the branch.  To be concrete:

	1. Branch REL_X_STABLE is forked off trunk.
	2. Time passes, some commits occur in REL_X_STABLE.
	3. File A gets added to trunk.
	4. More time passes, more commits occur in REL_X_STABLE.
	5. We make a release and apply a tag REL_X_Y in the branch.
	   (In CVS this means that every single RCS file that has
	   live content in the branch receives a tag marker.  Since
	   file A is not in the branch, it gets no tag marker.)
	6. File A gets added to branch REL_X_STABLE.

In the representation used by CVS, the commit 6 appears to be a direct
child of commit 3 (or maybe even commit 1, I forget); therefore it
appears that file A has existed on the branch since its inception.
But the lack of a REL_X_Y tag marker puts the lie to that appearance,
so cvs2git can tell the history is inconsistent.  To fix it, we need to
insert a deletion event on the branch immediately after commit 3
(or was it commit 1? ... anyway look at the pgsql-hackers discussions
for details).  Recent versions of CVS know to insert a special deletion
event when first adding a file to a branch, but older ones didn't.

One thing that took me awhile to figure out is that these magic deletion
events have to conform to exactly the format cvs2git expects, including
the wording of the manufactured commit message, else it fails to
understand what it's supposed to do with them.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-08 06:27  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-08 06:27 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Okay, thanks for the tips. I found the relevant mailing list archives
and have been looking through the chronicles of the conversion. I'm a
little scared and very impressed. If anyone else is interested,

http://archives.postgresql.org/pgsql-hackers/2010-09/msg00636.php
(Tom's main post-conversion/cleanup report, including some details on
the RCS hacks)
http://archives.postgresql.org/pgsql-hackers/2010-08/msg01247.php
(thread detailing original issues)
http://archives.postgresql.org/pgsql-hackers/2010-09/msg00014.php
(continuation of above)

There are some other threads that month, but nothing else seems
directly relevant. I'll spend some time digging through these and try
the same RCS hack.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-20 11:11  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-20 11:11 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

FYI: still working on this. It was a little more involved than I
realized, but it's coming along now. I understand the dummy commit
issue and have crafted CVS history that seems to turn the manufactured
commits benign (they're still there, but the history around them is
not crazy). We can filter them out later. I've also restored Marko's
original author mapping (which seems to cover everything, but I'll
double-check against the list Tom sent out) and started using an svn
trunk checkout of cvs2git (the older version I have chokes on Marko's
config).

My conversion scripts are still available at
https://github.com/deafbybeheading/pgjdbc2git . I've been working on
the older dump that Kris had provided, but everything is automated and
a conversion takes  a minute or two, so syncing it with any recent
changes should not be a big deal.

Remaining work:
 - Fix another couple of occurrences of the missing deletion
 - Add automatic validation of tags (and possibly other points in
history) based on Marko's script
 - Validate author mappings
 - Manually inspect/compare repository histories
 - Keyword expansion (It looks like the core PostgreSQL project just
replaced these with file name only; that's probably sensible)

I'll keep working on this and send out another update.

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2011-12-28 02:18  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2011-12-28 02:18 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Ok, some more progress:

I've taken care of all but two of the manufactured commit issues, have
a step to strip keywords (more on that later), and have done some
preliminary spot-checks of the generated history.

The two manufactured commits that probably warrant a little more attention:

maciek@anemone:~/jdbc-to-git/pgjdbc2git/pgjdbc-checkout$ git log --all
--grep=manufactured
commit e64c318487848ebd7dee6b795dc360a3633337e3
Author: CVS to git conversion script <webmaster@postgresql.org>
Date:   Fri Jul 27 10:15:40 2007 +0000

    This commit was manufactured by cvs2git to create tag 'REL8_2_505'.

    Sprout from REL8_2_STABLE 2007-04-18 08:15:18 UTC Kris Jurka
<books@ejurka.com> 'Prepare for release of 8.2-505.'
    Cherrypick from master 2007-07-27 10:15:39 UTC Kris Jurka
<books@ejurka.com> 'Remove unused imports.':
        META-INF/services/java.sql.Driver
        org/postgresql/test/jdbc4/Jdbc4TestSuite.java
        org/postgresql/test/jdbc4/LOBTest.java

commit bb06ce11331182c6e0cb73adc6e494c4b92da8c1
Author: CVS to git conversion script <webmaster@postgresql.org>
Date:   Mon Oct 12 02:45:46 1998 +0000

    This commit was manufactured by cvs2git to create branch 'REL6_4'.

    Sprout from master 1998-10-12 02:45:45 UTC Bruce Momjian
<bruce@momjian.us> 'This patch updates the ImageViewer example to use
Multiple Threading.'
    Delete:
        postgresql/ChangeLog
        postgresql/PG_Object.java
        postgresql/PGbox.java
        postgresql/PGcircle.java
        postgresql/PGlseg.java
        postgresql/PGpath.java
        postgresql/PGpoint.java
        postgresql/PGpolygon.java
        postgresql/PGtokenizer.java


The first of these is weird because it's actually a *tag*. The second
is weird because it's a number of deletions back-patched into REL6_4
(which seems to be a stub branch with only a single commit), with an
irrelevant commit message. I'm happy to pull the standard metadata
wrangling for these as well, but I'd like to understand what's going
on here if someone with more repo history knowledge has some insight.

I've also run Marko's verify script and the diffs seem benign (some
keyword expansion stuff). As I understand from reading the core
PostgreSQL lists, the solution taken there was to port over with
expansion, and then kill expansion on all active branches in a series
of post-conversion commits. Is that acceptable here?

Any other questions or comments?

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-20 23:02  Kris Jurka <books@ejurka.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Kris Jurka @ 2012-01-20 23:02 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc



On Tue, 27 Dec 2011, Maciek Sakrejda wrote:

> Ok, some more progress:
> 
> I've taken care of all but two of the manufactured commit issues, have
> a step to strip keywords (more on that later), and have done some
> preliminary spot-checks of the generated history.
> 
> The two manufactured commits that probably warrant a little more attention:
> 
> maciek@anemone:~/jdbc-to-git/pgjdbc2git/pgjdbc-checkout$ git log --all
> --grep=manufactured
> commit e64c318487848ebd7dee6b795dc360a3633337e3
> Author: CVS to git conversion script <webmaster@postgresql.org>
> Date:   Fri Jul 27 10:15:40 2007 +0000
> 
>     This commit was manufactured by cvs2git to create tag 'REL8_2_505'.
> 
>     Sprout from REL8_2_STABLE 2007-04-18 08:15:18 UTC Kris Jurka
> <books@ejurka.com> 'Prepare for release of 8.2-505.'
>     Cherrypick from master 2007-07-27 10:15:39 UTC Kris Jurka
> <books@ejurka.com> 'Remove unused imports.':
>         META-INF/services/java.sql.Driver
>         org/postgresql/test/jdbc4/Jdbc4TestSuite.java
>         org/postgresql/test/jdbc4/LOBTest.java
> 

This tag should never have been applied to these three files.  I'm not 
sure how that happened, but please just remove the tag from these files.


> commit bb06ce11331182c6e0cb73adc6e494c4b92da8c1
> Author: CVS to git conversion script <webmaster@postgresql.org>
> Date:   Mon Oct 12 02:45:46 1998 +0000
> 
>     This commit was manufactured by cvs2git to create branch 'REL6_4'.
> 
>     Sprout from master 1998-10-12 02:45:45 UTC Bruce Momjian
> <bruce@momjian.us> 'This patch updates the ImageViewer example to use
> Multiple Threading.'
>     Delete:
>         postgresql/ChangeLog
>         postgresql/PG_Object.java
>         postgresql/PGbox.java
>         postgresql/PGcircle.java
>         postgresql/PGlseg.java
>         postgresql/PGpath.java
>         postgresql/PGpoint.java
>         postgresql/PGpolygon.java
>         postgresql/PGtokenizer.java

I don't have any context for this ancient change, but I've done a little 
digging, and I believe the historical action was:

1) Make some modifications.
2) Remove the files in the generated commit.
3) Branch the REL6_4 release.

I think anytime the last action before a branch is a delete, cvs2git 
will be confused because the deleted files don't get tagged, so the 
branch date comes from the last non-delete modification and it doesn't see 
the deletes as occuring before the branch.

What we want is the REL6_4 branch point to be after the delete 
commit.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-23 00:03  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2012-01-23 00:03 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

Thanks, Kris--I really appreciate the help. I added patches to the
conversion script to strip the tags from that first set, but I'm still
not sure what to do on the second set, since it looks like there is no
other activity on the REL6_4 branch (no tags, even). It seems like
what you are saying is that REL6_4 should just point at the next
commit in the main development branch: is that right?

That is, this is the git history from around there (git log --all
--stat --graph --until '1999-01-16' --decorate):
https://gist.github.com/1659451

It looks like the same set of changes was committed to both trunk and
the branch, and nothing else ever happened on that branch. You're
saying that we should just drop that branch point and have the git
branch point at f44a35... (see gist linked above) as a stub branch
(that is, a branch with no commits of its own), yes?

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



On Fri, Jan 20, 2012 at 3:02 PM, Kris Jurka <books@ejurka.com> wrote:
>
>
> On Tue, 27 Dec 2011, Maciek Sakrejda wrote:
>
>> Ok, some more progress:
>>
>> I've taken care of all but two of the manufactured commit issues, have
>> a step to strip keywords (more on that later), and have done some
>> preliminary spot-checks of the generated history.
>>
>> The two manufactured commits that probably warrant a little more attention:
>>
>> maciek@anemone:~/jdbc-to-git/pgjdbc2git/pgjdbc-checkout$ git log --all
>> --grep=manufactured
>> commit e64c318487848ebd7dee6b795dc360a3633337e3
>> Author: CVS to git conversion script <webmaster@postgresql.org>
>> Date:   Fri Jul 27 10:15:40 2007 +0000
>>
>>     This commit was manufactured by cvs2git to create tag 'REL8_2_505'.
>>
>>     Sprout from REL8_2_STABLE 2007-04-18 08:15:18 UTC Kris Jurka
>> <books@ejurka.com> 'Prepare for release of 8.2-505.'
>>     Cherrypick from master 2007-07-27 10:15:39 UTC Kris Jurka
>> <books@ejurka.com> 'Remove unused imports.':
>>         META-INF/services/java.sql.Driver
>>         org/postgresql/test/jdbc4/Jdbc4TestSuite.java
>>         org/postgresql/test/jdbc4/LOBTest.java
>>
>
> This tag should never have been applied to these three files.  I'm not
> sure how that happened, but please just remove the tag from these files.
>
>
>> commit bb06ce11331182c6e0cb73adc6e494c4b92da8c1
>> Author: CVS to git conversion script <webmaster@postgresql.org>
>> Date:   Mon Oct 12 02:45:46 1998 +0000
>>
>>     This commit was manufactured by cvs2git to create branch 'REL6_4'.
>>
>>     Sprout from master 1998-10-12 02:45:45 UTC Bruce Momjian
>> <bruce@momjian.us> 'This patch updates the ImageViewer example to use
>> Multiple Threading.'
>>     Delete:
>>         postgresql/ChangeLog
>>         postgresql/PG_Object.java
>>         postgresql/PGbox.java
>>         postgresql/PGcircle.java
>>         postgresql/PGlseg.java
>>         postgresql/PGpath.java
>>         postgresql/PGpoint.java
>>         postgresql/PGpolygon.java
>>         postgresql/PGtokenizer.java
>
> I don't have any context for this ancient change, but I've done a little
> digging, and I believe the historical action was:
>
> 1) Make some modifications.
> 2) Remove the files in the generated commit.
> 3) Branch the REL6_4 release.
>
> I think anytime the last action before a branch is a delete, cvs2git
> will be confused because the deleted files don't get tagged, so the
> branch date comes from the last non-delete modification and it doesn't see
> the deletes as occuring before the branch.
>
> What we want is the REL6_4 branch point to be after the delete
> commit.
>
> Kris Jurka



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-23 19:16  Kris Jurka <books@ejurka.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Kris Jurka @ 2012-01-23 19:16 UTC (permalink / raw)
  To: Maciek Sakrejda <msakrejda@truviso.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc



On Sun, 22 Jan 2012, Maciek Sakrejda wrote:

> Thanks, Kris--I really appreciate the help. I added patches to the
> conversion script to strip the tags from that first set, but I'm still
> not sure what to do on the second set, since it looks like there is no
> other activity on the REL6_4 branch (no tags, even). It seems like
> what you are saying is that REL6_4 should just point at the next
> commit in the main development branch: is that right?

Correct.

> It looks like the same set of changes was committed to both trunk and
> the branch, and nothing else ever happened on that branch. You're
> saying that we should just drop that branch point and have the git
> branch point at f44a35... (see gist linked above) as a stub branch
> (that is, a branch with no commits of its own), yes?

Yes.

Also, I've posted an updated version of the CVS repo at:

http://ejurka.com/pgsql/tmp/

It didn't produce any new manufactured commits, so I think we're getting 
close to being ready for a move.  I will start a new thread to discuss the 
actual details/timing of that.


Kris Jurka



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-24 18:05  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2012-01-24 18:05 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

>> It looks like the same set of changes was committed to both trunk and
>> the branch, and nothing else ever happened on that branch. You're
>> saying that we should just drop that branch point and have the git
>> branch point at f44a35... (see gist linked above) as a stub branch
>> (that is, a branch with no commits of its own), yes?
>
> Yes.

Done. I think the only remaining thing is the keyword cleanup. I
presume what I suggested before works (keep keyword expansion as it
was in CVS; do a cleanup commit in git in all active branches to purge
expandable keywords; I believe this is what the main project did)? I
took out the "grep -v"s from the tag verification script to see what
was there, and there are some subtantial diffs around that. I tried
tweaking the cvs2git config, but that only gives different diffs. I
need to spend more time looking at this, but I should be done soon
(though if anyone has any insight here, I welcome it).

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-27 07:27  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2012-01-27 07:27 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

One more thing: are we missing the config for the $PostgreSQL$ custom
keyword in that tarball? I thought it was being processed properly,
but now that I've read up a bit on CVS keywords, I think it may not be
processed at all because the config is missing.
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-27 17:22  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2012-01-27 17:22 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

I'm now working on getting the keyword expansion right. Some files in
older revisions have $Header$ keywords, which include the full path on
expansion, which is a problem (since the expanded version has to be
committed to git). I looked at what the server project did, and the
CVS root references seem to have been replaced with "/cvsroot". I
added functionality to do this on conversion in cvs2git (seems to
work; will try to commit a patch upstream), and added it as a prep
step to the CVS checkouts in the verify-tags.sh script, but I still
see diffs:

diff -r '--exclude=CVS' '--exclude=.git' ./Makefile ../cvs-co/REL6_5/Makefile
7c7
< #    $Header: /cvsroot/pgjdbc/Makefile,v 1.14 1999-06-23 05:56:17 peter Exp $
---
> #    $Header: /cvsroot/pgjdbc/Attic/Makefile,v 1.14 1999-06-23 05:56:17 peter Exp $

There are several dozen of these across all the various tags. The left
is the git conversion, the right is the CVS checkout. Everything in
the CVS checkout seems to be in the attic (even though the files
themselves are not--at least not at those checked out tags). Is this
expected? Does it have to do with the missing config file?

Thanks,
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-01-30 18:40  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 1 reply; 32+ messages in thread

From: Maciek Sakrejda @ 2012-01-30 18:40 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

> There are several dozen of these across all the various tags. The left
> is the git conversion, the right is the CVS checkout. Everything in
> the CVS checkout seems to be in the attic (even though the files
> themselves are not--at least not at those checked out tags). Is this
> expected? Does it have to do with the missing config file?

So not much news on this front except that I did a fresh checkout from
pgjdbc CVS, and I seem to have the same "/Attic/" path component on
those $Header$ expansions in old branches. I still don't understand
it, but it seems legit. If I don't hear otherwise, I'll throw a git
filter-branch step into the conversion process to make git history
consistent with these.

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread

* Re: test git conversion
@ 2012-02-01 11:45  Maciek Sakrejda <msakrejda@truviso.com>
  parent: Maciek Sakrejda <msakrejda@truviso.com>
  0 siblings, 0 replies; 32+ messages in thread

From: Maciek Sakrejda @ 2012-02-01 11:45 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Marko Kreen <markokr@gmail.com>; Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc

The "/Attic" issue turned out to be a cvs2git problem; Michael
Haggerty fixed it very quickly. We now convert with spotless [1]
verification across all 80 (!) tags and the history looks clean. I
think we're ready to roll.

The conversion process is a little convoluted, but most of it is
automated. As before, the scripts to do the conversion are on github:
https://github.com/deafbybeheading/pgjdbc2git/ . In theory, I think
anyone running the script against the same repository bundle *should*
produce the same git history, but I didn't want to push the result to
github yet just in case.

[1]: Because git avoids CVS-style keywords, the conversion cannot be
perfect; in verification I substitute "/cvsroot" for the repository
root (though this only affects some older branches)
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com



^ permalink  raw  reply  [nested|flat] 32+ messages in thread


end of thread, other threads:[~2012-02-01 11:45 UTC | newest]

Thread overview: 32+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05 07:42 test git conversion Marko Kreen <markokr@gmail.com>
2011-10-05 10:04 ` Marko Kreen <markokr@gmail.com>
2011-10-05 14:58   ` Tom Lane <tgl@sss.pgh.pa.us>
2011-10-05 15:15     ` Marko Kreen <markokr@gmail.com>
2011-10-05 16:03       ` Marko Kreen <markokr@gmail.com>
2011-10-05 16:07         ` Kris Jurka <books@ejurka.com>
2011-10-05 16:10           ` Marko Kreen <markokr@gmail.com>
2011-10-06 07:48             ` Maciek Sakrejda <msakrejda@truviso.com>
2011-10-06 08:13               ` Marko Kreen <markokr@gmail.com>
2011-12-06 21:04                 ` Dave Cramer <pg@fastcrypt.com>
2011-12-06 21:23                   ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-06 21:26                     ` Dave Cramer <pg@fastcrypt.com>
2011-12-06 21:38                       ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-06 21:28                     ` Dave Cramer <pg@fastcrypt.com>
2011-12-06 21:39                       ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-06 21:34                     ` Marko Kreen <markokr@gmail.com>
2011-12-06 21:45                       ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-07 04:32                         ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-07 07:25                           ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-08 01:33                             ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-08 02:16                               ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-08 06:27                                 ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-20 11:11                                   ` Maciek Sakrejda <msakrejda@truviso.com>
2011-12-28 02:18                                     ` Maciek Sakrejda <msakrejda@truviso.com>
2012-01-20 23:02                                       ` Kris Jurka <books@ejurka.com>
2012-01-23 00:03                                         ` Maciek Sakrejda <msakrejda@truviso.com>
2012-01-23 19:16                                           ` Kris Jurka <books@ejurka.com>
2012-01-24 18:05                                             ` Maciek Sakrejda <msakrejda@truviso.com>
2012-01-27 07:27                                               ` Maciek Sakrejda <msakrejda@truviso.com>
2012-01-27 17:22                                                 ` Maciek Sakrejda <msakrejda@truviso.com>
2012-01-30 18:40                                                   ` Maciek Sakrejda <msakrejda@truviso.com>
2012-02-01 11:45                                                     ` Maciek Sakrejda <msakrejda@truviso.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox