-
Notifications
You must be signed in to change notification settings - Fork 3
Home
I don’t work with VSS anymore, so it’s highly unlikely that I will be developing this any further. If you need any changes, feel free to fork.
This script implements bi-directional exchange of simple changes between Git and VSS. It depends on the logging feature of VSS, which is the only way to quickly find what changed without scanning the whole repository.
The first step is to ensure that logging is enabled in VSS, and then create a Git mirror of the VSS repository. This operation can be done by first converting it to svn via vss2svn, or by any other available means.
The next step is to create a bare repository with the necessary branches (normally on a network share), and initialize git-vss using the following command from within it:
git vss --init [--no-mappings] [--no-fetch] \ branchname vss_repo log_path log_offset < mappings.txt
Here branchname specifies the Git branch, vss_repo is the path to the VSS repository, log_path names the VSS log file, and log_offset specifies an offset where to start reading it. This offset should generally be the size of the file at the moment when the initial snapshot was taken.
(It is also possible to initialize a branch by importing a check-out. To do this, use --import=path
instead of --init
.)
The mappings specify how paths in VSS map to paths in the Git repository, using the following format:
/vss/path/one = /git/path /vss/path/two = /git /vss/path/two/junk = IGNORE ...
During processing the script uses the longest matching prefix.
In order to create a working copy, clone the bare repository and run the following command:
git vss --connect <path-to-the-bare-repo>
Note: the bare repository is maintained as a mirror of the VSS one, except that all commits done by git-vss are directly pushed there so that all meta-data is preserved intact.
It is possible to import a mapping of VSS logins to Git-style authors and e-mails, and a list of file names, by running this command in the central bare repository:
--load [--authors=file] [--filenames=file]
The file name list is used to canonify the case in order to work around some issues in past versions of Git regarding filename case on case-insensitive filesystems. This feature may be obsolete by now.
TODO
Usage: git-vss [-h|--help] [--root=GIT_repository] parameters... Update Git from VSS: [--new-head] [--checkout] [--rebase] branchname Commit changes from Git into VSS: --commit [--squash=title[:]] branchname Undo previous checkouts: --undo-checkouts [branchname] Repin commits to the specified branch: --repin branchname commit commit... Initialize repository: --connect base_path (--init|--import=path) [--no-mappings] [--no-fetch] branchname vss_repo log_path log_offset < mappings (--load|--dump) [--authors=file] [--filenames=file] Canonify newly-added file names in the index: --sanitize-adds