• OT: A somewhat special Subversiom question

    From Helmut Giese@21:1/5 to All on Mon Apr 3 06:47:21 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Mon Apr 3 07:55:12 2023
    Am 03.04.23 um 07:54 schrieb Christian Gollwitzer:
    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.

    Apparently, svn can do this as well:

    https://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.blame.html


    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Mon Apr 3 07:54:02 2023
    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.

    Apparently, there is a tool called "git-svn" which allows you to clone
    an svn repository via git. Unfortunately, I don't know how the commits
    turn out then, because git uses hashes as commit handles, while svn uses version numbers.



    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From heinrichmartin@21:1/5 to Helmut Giese on Mon Apr 3 00:57:26 2023
    On Monday, April 3, 2023 at 6:47:25 AM UTC+2, Helmut Giese wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Giese@21:1/5 to heinrichmartin on Mon Apr 3 19:12:35 2023
    heinrichmartin <martin.heinrich@frequentis.com> schrieb:

    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.

    This is what makes clt so wonderful: There are so many knowledgeable
    AND helpful people around that one can come along with about any
    question and has a good chance to get a helpful answer.
    Many, many thanks to Christian and Heinrich - 'svn blame' did the job. Greetings from a happy
    Helmut

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)