|
From: Daniel J S. <dan...@ie...> - 2017-10-10 07:58:11
|
On 10/09/2017 04:14 PM, Daniel J Sebald wrote: > BUT, I may have hit upon a more reliable and straightforward approach > from an automated script standpoint. It's based on what I pointed out > about the ChangeLog file typically being listed in the diff hunks. > Experiment with the following git command: > > git log -p --unified=20 ChangeLog > > That gives us the log record for the ChangeLog, printing out the diff > hunks in the ChangeLog and with enough context lines such that it > displays back to the Date/Contributor/Address line. (Use --unified=30 > if one thinks there could be that length of comment.) > > With such a record, the script can search for the changes in the file > (i.e., "+" as character in the first location of the line), and then > search backward for the Date/Contributor/Address info. With a few > heuristic rules, this might be rather accurate, in theory. Mojca, HBB, I've written a short C++ utility to extract the authorship info from the ChangeLog diff hunks per changeset and posted the code here: https://sourceforge.net/p/gnuplot/patches/763/ along with a file containing the g++ command to compile it. Once built, type git_changelog_author --help for a description of how to use it. Basically git log -p --unified=50 ChangeLog > ChangeLog.diff git_changelog_author ChangeLog.diff > author.txt will give a condensed list of git ID and authorship information, whitespace reduce to a single character and no whitespace within the email address. Give it a try. It's very fast. Commit the program to the repository in some utility directory, if you like, then we can tweak the code for your use. Or, just post new versions to the patch report. Dan |