Am 03.04.23 um 06:47 schrieb Helmut Giese:
Hello out there
I know that Subversion at a commit does not save whole files but only
differences to the previous version. So it should be possible
- to look through all revisions,
- search for the file in question,
- look for the first occurence of the function in question and report
the revision.
Now my question(s):
- Does anybody know of a tool or script that has attempted something
like this before?
"git annotate" can do that in a git repo. It shows a file where each
line is prefixed with the latest commit that changed this line.
Hello out there
I know that Subversion at a commit does not save whole files but only differences to the previous version. So it should be possible
- to look through all revisions,
- search for the file in question,
- look for the first occurence of the function in question and report
the revision.
Now my question(s):
- Does anybody know of a tool or script that has attempted something
like this before?
Hello out there
I know that Subversion at a commit does not save whole files but only differences to the previous version. So it should be possible
- to look through all revisions,
- search for the file in question,
- look for the first occurence of the function in question and report
the revision.
Now my question(s):
- Does anybody know of a tool or script that has attempted something
like this before?
- If not: What would be the relevant files to search in and in which
format are they (text? SQL? any other?)
Any link or idea will be greatly appreciated.
Helmut
As Christian has already found out, "svn blame" is your friend.
You might need to iterate over past revisions to actually identify the _first_ occurrence (if that definition line was modified later).
I.e. if "svn blame" reports revision N, cross-check revision N-1: iirc, "svn blame -r<N-1>" or "svn cat -r<N-1>" should help.
Be aware that svn does not know about functions. Therefore, you will need to care if the function has been moved in the code base.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 33:44:41 |
Calls: | 6,669 |
Calls today: | 1 |
Files: | 12,216 |
Messages: | 5,338,369 |