Finding Changes by Old SVN Revision Numbers After Moving to Git
An SVN revision names a point in time for the whole repository, so once you split repositories during a Git migration, one revision can map to several commits. A lookup table that keeps the source repository UUID and path, how to record intentional exclusions, and an acceptance test with the migration owner out of the room.
Six months after switching version control to Git, an audit document says: "Billing display rule changed, applied in SVN r18432." All the code was migrated, but typing 18432 into the new repository's search returns nothing. What you need here isn't someone who remembers the old system. You need a lookup table that leads from an old revision to the new code.
To find a change by its old revision number after an SVN-to-Git migration, the migration deliverables must include a table mapping source repository, revision and path to commits in the new repositories.
Why does one SVN revision become two Git commits?
An SVN revision number identifies a point in time for the entire repository, so when you split the repository during migration, one revision can correspond to several commits. A single r18432 might change both the API and a notice screen. If those two now live in separate Git repositories, one old revision maps to two new commits. Another SVN repository may also have an r18432, so you need the source repository's identifier and the path as well.
| Original SVN record | Location after migration | What to check |
|---|---|---|
Repo A · r18432 · /api/trunk | commit 71ab2c4 in billing-api | Is the billing change there along with the tests of that time? |
Repo A · r18432 · /notice/trunk | commit be441d8 in notice-web | Can you also find the screen text changed that same day? |
Repo A · r18435 · /api/tags/v2.4 | release tag v2.4 in billing-api | Do files checked out from the tag match the baseline that shipped? |
The Git IDs above are shortened for readability. The real mapping keeps full commit IDs and the source SVN repository UUID. If a revision only touched paths outside the migration scope, record the reason, such as no target commit · archived separately to document store. Otherwise an empty search result sends someone off to investigate whether it's a gap or an intentional exclusion.
Which revisions should you sample after the migration?
Three samples are especially useful: one revision that fixed a production incident, one copy that created a branch, and one tag that was actually delivered. Compare the author account and timestamp, and open the files at that point on both sides. SVN tags are usually directory copies, so if a tag was modified after it was created, also note which state you chose as the Git release tag.
If you migrated with git svn and kept its mapping metadata, git svn find-rev looks up the Git commit for an SVN revision, and you can name the branch to search if needed.
Who should run the final acceptance test?
An operations engineer, not the migration owner, should run the final acceptance test, ideally while the migration owner is away. Hand them one old approval number and ask which code and which delivered build changed. The way work itself shifts when a lock-based team moves to Git is covered in We lock files before editing them.
- #svn
- #git
- #migration
- #traceability
- #audit