Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the best matching revision in a version control system?

I downloaded a single file from an subversion repository (subversion) long time ago. So this is not a checkout from that repository. I altered this file, but I do not remember the revision when I downloaded this file.

The project evolved and now I want to merge these to files (after two years). This file is a huge script.

So my basic attempt is to find the best matching revision from repository in order to see what I've altered and then finally merge these two files. For that purpose I would checkout every revision from which I am thinking it could be this revision until now, make a diff, and count lines. I think, the smallest diff will give me the best matching revision.

Any other Idea?

like image 614
math Avatar asked Dec 08 '11 07:12

math


1 Answers

It is an interesting question, but at the end, you have to merge with the latest revision of the file (if it currently exists, if not, you have another problem). So I don't think that the best matching revision gives you a better start point than the current revision.

So try to diff with the current revision, and if you don't understand how it evolved, read (with a good tool, best graphically) how the file has changed to understand where which lines of code came from.

like image 148
mliebelt Avatar answered Oct 16 '22 16:10

mliebelt