gitgithubmigrationaccurev

How can I omit all binary files when migrating from AccuRev to Git using ac2git


I'm working on moving an AccuRev v5.7 depot to Git and I'm leveraging a great open source tool named ac2git available on GitHub. I'm an experienced AccuRev user and fairly new to Git.

The AccuRev depot being migrated has hundreds of GBs of binary file history and all I care about is the source code history as well as the final promoted set of binaries (in order to provide binary compatibility with some legacy COM builds.)

From the GitHub documentation and personal experimentation I have been successful in migrating a much smaller sub-set of transactions leveraging the 'start-transaction' and 'end-transaction' configurable XML parameters. However, this does not do what I need. I want start-transaction to be '1' and the end-transaction to be 'now' with the specific omission of binary files in the promotes (aside from latest commit.)

I've researched some commands in Git and it is possible to purge certain files and re-write the history on a commit/push although this requires the 'ac2git.py' script to first pull hundreds of GBs of data to my local Git repository and I would also rather try to avoid this approach by omission of the binaries during the migration process.

I've tried using a .gitignore file on the local repository in which the migration is being run although binaries are still being pulled.

I'm hoping someone can provide one of the following:

  1. A quick edit/hack to the Python script to omit the binaries. Perhaps from the original author or a contributor to the project since it is actively being maintained.

  2. A Git expert who can recommend a better way to handle the removal of the binaries without having to re-create history.

  3. An alternate approach that produces the desired result.


Solution

  • I've answered a similar question here.

    In essence, the script uses the accurev pop command to retrieve the information from Accurev. This is implemented in the TryPop() method in the ac2git.py file.

    You would just need to modify the call to accurev.pop(), to restrict it to only download the non-binary files, so long as you can determine what files are binary without downloading them.

    The pop() method is defined in the accurev.py script and you will want to use the elementList or listFile arguments to specify the non-binary files you want to populate.

    For this to work Accurev 5.7 needs to support the <element-list> argument or the -l option. These are available in the Accurev 6.2 CLI but I don't know if that's the case for Accurev 5.7.