Menu

#763 C++ utility to aid in sorting out ChangeLog authorship for CVS-to-git repository conversion

Version 6
closed-out-of-date
nobody
None
5
2025-07-21
2017-10-10
Dan Sebald
No

I've written a short utility that will process the diff hunks to the ChangeLog file, searching backward for the Date/Name/Address that the commit should be attributed to. The build command is in the file "build". Once compiled, try something like

git log -p --unified=50 ChangeLog > ChangeLog.diff
git_changelog_author ChangeLog.diff > author.txt

The author.txt file will be a nice condensed list that someone can use to post process the git repository authorship in an automated way.

The logic can be deciphered from the code, but if you want explanation, just ask. I will emphasize again that this is only gleaning info for diff hunks (i.e., changes) in the ChangeLog file itself. Any commits, for example, that didn't have a change in the ChangeLog will not be detected, so those just fall back to the maintainer who made such a change in terms of authorship.

2 Attachments

Discussion

  • Dan Sebald

    Dan Sebald - 2017-10-13

    It's been requested that the gitID be modified from the SHA to the following format:

    <committer-id!yyyy-mm-ddThh:mm:ssZ>
    

    This can be done without a change in the code. Try the following sequence of commands instead:

    git log --format='commit <%cE!%cIZ>' -p --unified=50 ChangeLog > ChangeLog.diff
    git_changelog_author ChangeLog.diff > author.txt
    

    This seems to work nicely, distinguishing the commiter from the author.

     
  • Dan Sebald

    Dan Sebald - 2017-10-16

    I'm attaching a second version of the utility, version 0.2 beta. This version allows a second input file with a git-log containing the list of files that have changed. If provided, the utility will discard any entries in which ChangeLog was the only file that changed in the changeset.

    Example usage:

    git log --format='commit <%cE!%cIZ>' -p --unified=50 ChangeLog > CL.diff
    git log --format='commit <%cE!%cIZ>' --name-only > files.lst
    git_changelog_author CL.diff files.lst > author.txt
    
     
  • Dan Sebald

    Dan Sebald - 2017-10-16

    Another tiny modification, but I think it has no ramifications on the final list. Version 0.3 beta.

     
  • Dan Sebald

    Dan Sebald - 2017-10-22

    Here's a new Version 0.4 beta that does not stop at the first added line in the ChangeLog, but instead looks a little further for the first item in the addition block. An item has a star or colon in the line somewhere. The idea is to allow situations where the first addition might be a space or something similar while the author information is actually in the addition hunk a line or two later.

    Here are four cases that are corrected by this new version:

    commit <sfeam!2008-05-30T04:52:36+00:00Z>
    
    diff --git a/ChangeLog b/ChangeLog
    index 429292d..3d59ab0 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,54 +1,64 @@
     2008-05-29  Ethan A Merritt  <merritt@u.washington.edu>
    
        * src/axis.c (make_tics):  Don't generate tics for an empty axis range.
    
    +   * term/pbm.trm (PBM_options):  Make the tic size independent of the
    +   font size.
    +   Bug #1969415
    +
    +2008-05-29  Daniel Sebald  <daniel.sebald@ieee.org>
    +
    +   * src/hidden3d.c (sort_polys_by_z in_front coord_to_treecell):
    +   Add range-checks to the calculation of quadtree array indices.
    +   Bugs #1969415 #1728063
    +
    
    commit <sfeam!2006-07-21T02:35:44+00:00Z>
    
    diff --git a/ChangeLog b/ChangeLog
    index 95e775f..ae0940c 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,53 +1,63 @@
     2006-07-19  Shigeharu Takeno  <shige@iee.niit.ac.jp>
    
        * docs/gnuplot-ja.doc: Sync to current English version.
    +   (Update to term-ja.diff is not needed, since the patchset it tracks
    +   was reverted).
    +
    +2006-07-19  Ethan A Merritt <merritt@u.washington.edu>
    +
    +   * term/*.trm:  Revert patchset of 2006-07-06
    +   Restore explicit help entries for "set term foo ...".
    +   Daniel has a patch to help.c which would obviate this fix, but I judge
    +   that had better wait til after 4.2.  This returns us to a state that
    +   was satisfactory for a long time.
    
    commit <joze!2000-09-20T00:59:24+00:00Z>
    
    diff --git a/ChangeLog b/ChangeLog
    index c6422fc..ced24ca 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,50 +1,58 @@
    +
    +2000-09-20  Johannes Zellner <johannes@zellner.org>
    +
    +   * relative arrows:
    +     set arrow from start_x, start_y rto delta_x, delta_y
    +   * if front was given, the arrow head stuff wasn't applied.
    +     I repaired this. (also for 3d plots).
    +
    
    commit <joze!2000-05-04T20:55:19+00:00Z>
    
    diff --git a/ChangeLog b/ChangeLog
    index 63164cb..607f9e2 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,50 +1,57 @@
    +
    +2000-05-01  Johannes Zellner <johannes@zellner.org>
    +
    +   * src/command.c: always include ipc.h
    +
    +   * term/linux.trm: typedef int in declaration of linux_line_func_ptr
    +
    
     
  • Dan Sebald

    Dan Sebald - 2017-11-09

    I've added some supporting script files and C++ source files that will convert the gnuplot CVS repository using cvs2git, git, g++ and sed. I've placed all the files in their own git repository, but also the actual files are present, so just run

    tar -xzf git_translation.tar.gz

    and look through the README for instructions. The only thing done to enhance the cvs2git result is to use sed to put proper committer info in the cvs2git dump file and add author information to the cvs2git dump file. Otherwise, all tags in the new git repository remain as they are in the CVS repository. Tags can be altered after the creation of the repository if so desired. Also, one can create a branch at the base and add pre-CVS versions in tar archive files.

     
  • Ethan Merritt

    Ethan Merritt - 2018-06-22
    • status: open --> closed-out-of-date
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.