Skip to content

Commit 5392048

Browse files
ad1217tnyblom
authored andcommitted
Add basic documentation for rules
1 parent 3f965dd commit 5392048

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,57 @@ Write the Rules
4242
You need to write a rules file that describes how to slice the Subversion history into Git repositories and branches. See https://techbase.kde.org/Projects/MoveToGit/UsingSvn2Git.
4343
The rules are also documented in the 'samples' directory of the svn2git repository. Feel free to add more documentation here as well.
4444

45+
Rules
46+
-----
47+
### `create respository`
48+
49+
```
50+
create repository REPOSITORY NAME
51+
[PARAMETERS...]
52+
end repository
53+
```
54+
55+
`PARAMETERS` is any number of:
56+
57+
- `repository TARGET REPOSITORY` Creates a forwarding repository , which allows for redirecting to another repository, typically with some `prefix`.
58+
- `prefix PREFIX` prefixes each file with `PREFIX`, allowing for merging repositories.
59+
- `description DESCRIPTION TEXT` writes a `DESCRIPTION TEXT` to the `description` file in the repository
60+
61+
### `match`
62+
63+
```
64+
match REGEX
65+
[PARAMETERS...]
66+
end match
67+
```
68+
69+
Creates a rule that matches paths by `REGEX` and applies some `PARAMETERS` to them. Matching groups can be created, and the values used in the parameters.
70+
71+
`PARAMETERS` is any number of:
72+
73+
- `repository TARGET REPOSITORY` determines the repository
74+
- `branch BRANCH NAME` determines which branch this path will be placed in. Can also be used to make lightweight tags with `refs/tags/TAG NAME` although note that tags in SVN are not always a single commit, and will not be created correctly unless they are a single copy from somewhere else, with no further changes. See also `annotate true` to make them annotated tags.
75+
- `[min|max] revision REVISION NUMBER` only match if revision is above/below the specified revision number
76+
- `prefix PREFIX` prefixes each file with `PREFIX`, allowing for merging repositories. Same as when used in a `create repository` stanza.
77+
- Note that this will create a separate commit for each prefix matched, even if they were in the same SVN revision.
78+
- `substitute [repository|branch] s/PATTERN/REPLACEMENT/` performs a regex substitution on the repository or branch name. Useful when eliminating characters not supported in git branch names.
79+
- `action ACTION` determines the action to take, from the below three:
80+
81+
- `export` I have no idea what this does
82+
- `ignore` ignores this path
83+
- `recurse` tells svn2git to ignore this path and continue searching it's children.
84+
85+
- `annotate true` creates annotated tags instead of lightweight tags
86+
87+
### `include FILENAME`
88+
89+
Include the contents of another rules file
90+
91+
### `declare VAR=VALUE`
92+
93+
Define variables that can be referenced later. `${VAR}` in any line will be replaced by `VALUE`.
94+
95+
4596
Work flow
4697
---------
4798
Please feel free to fill this section in.

0 commit comments

Comments
 (0)