Hope this will help.
Here is a Python 3 script for printing author name basing on your commit message format:
It could be tested with:
Code:
$ git log -n1 <commit_id> | python3 authors.py
For example:
Code:
$ git log -n1 af0740a3 | python3 authors.py
Kevin Hendricks
$ git log -n1 80150331 | python3 authors.py
Kevin Hendricks
$ git log -n1 7b32b687 | python3 authors.py
tkeo
$ git log -n1 91d3e282 | python3 authors.py
Various authors
And this script could be used with the following
--env-filter parameter for
git filter-branch:
Code:
--env-filter 'export GIT_AUTHOR_NAME="$(git log -n1 ${GIT_COMMIT} | python3 /full/path/to/authors.py)"; if [ "x${GIT_AUTHOR_NAME}" != "xKevin Hendricks" ]; then export GIT_AUTHOR_EMAIL=""; fi'
This is the result:
Spoiler:
Code:
$ git log|grep '^\(Author\|Date\):'
Code:
Author: Kevin Hendricks <kevinhendricks@users.noreply.github.com>
Date: Tue Oct 14 18:21:13 2014 -0400
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Fri Oct 10 00:00:00 2014 +0000
Author: Various authors <>
Date: Sat Sep 13 00:00:00 2014 +0000
Author: Various authors <>
Date: Tue Jul 15 00:00:00 2014 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Jul 10 00:00:00 2014 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Jul 10 00:00:00 2014 +0000
Author: Various authors <>
Date: Thu Jul 10 00:00:00 2014 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Jul 10 00:00:00 2014 +0000
Author: Various authors <>
Date: Tue Jul 8 00:00:00 2014 +0000
Author: Various authors <>
Date: Thu Jun 26 00:00:00 2014 +0000
Author: Various authors <>
Date: Wed Jun 25 00:00:00 2014 +0000
Author: tkeo <>
Date: Sun Jun 22 00:00:00 2014 +0000
Author: Various authors <>
Date: Wed Jun 18 00:00:00 2014 +0000
Author: Various authors <>
Date: Tue Jun 17 00:00:00 2014 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Sat Jun 14 00:00:00 2014 +0000
Author: Various authors <>
Date: Tue Jun 10 00:00:00 2014 +0000
Author: Various authors <>
Date: Sun May 18 00:00:00 2014 +0000
Author: Various authors <>
Date: Sat Apr 26 00:00:00 2014 +0000
Author: Various authors <>
Date: Sun Feb 23 00:00:00 2014 +0000
Author: tkeo <>
Date: Sun Feb 16 00:00:00 2014 +0000
Author: tkeo <>
Date: Sun Feb 9 00:00:00 2014 +0000
Author: Various authors <>
Date: Mon Apr 22 00:00:00 2013 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Fri Jan 17 00:00:00 2003 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Fri Jan 17 00:00:00 2003 +0000
Author: Various authors <>
Date: Mon Dec 10 00:00:00 2012 +0000
Author: Various authors <>
Date: Sat Oct 27 00:00:00 2012 +0000
Author: Various authors <>
Date: Fri Oct 26 00:00:00 2012 +0000
Author: DiapDealer <>
Date: Thu Sep 13 00:00:00 2012 +0000
Author: Various authors <>
Date: Wed Jul 25 00:00:00 2012 +0000
Author: Various authors <>
Date: Thu Apr 26 00:00:00 2012 +0000
Author: Various authors <>
Date: Fri Mar 23 00:00:00 2012 +0000
Author: Various authors <>
Date: Thu Mar 8 00:00:00 2012 +0000
Author: Various authors <>
Date: Sun Feb 12 00:00:00 2012 +0000
Author: Various authors <>
Date: Fri Jan 27 00:00:00 2012 +0000
Author: nickredding <>
Date: Fri Jan 27 00:00:00 2012 +0000
Author: Various authors <>
Date: Wed Jan 18 00:00:00 2012 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Fri Dec 23 00:00:00 2011 +0000
Author: Various authors <>
Date: Thu Oct 27 00:00:00 2011 +0000
Author: pdurrant <>
Date: Thu Sep 1 00:00:00 2011 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Fri Aug 5 00:00:00 2011 +0000
Author: siebert <>
Date: Sat Jul 23 00:00:00 2011 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Tue Jul 19 00:00:00 2011 +0000
Author: siebert <>
Date: Mon Jul 18 00:00:00 2011 +0000
Author: Various authors <>
Date: Mon Jun 27 00:00:00 2011 +0000
Author: pdurrant <>
Date: Wed May 18 00:00:00 2011 +0000
Author: pdurrant <>
Date: Sun Aug 29 00:00:00 2010 +0000
Author: pdurrant <>
Date: Mon Apr 12 00:00:00 2010 +0000
Author: pdurrant <>
Date: Sat Mar 13 00:00:00 2010 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Feb 18 00:00:00 2010 +0000
Author: pdurrant <>
Date: Thu Feb 18 00:00:00 2010 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Feb 18 00:00:00 2010 +0000
Author: pdurrant <>
Date: Wed Feb 17 00:00:00 2010 +0000
Author: pdurrant <>
Date: Thu Feb 11 00:00:00 2010 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Mon Feb 8 00:00:00 2010 +0000
Author: Various authors <>
Date: Sun Feb 7 00:00:00 2010 +0000
Author: pdurrant <>
Date: Fri Feb 5 00:00:00 2010 +0000
Author: Kevin Hendricks <kevin.b.hendricks@noreply-github.com>
Date: Thu Nov 12 00:00:00 2009 +0000
I guess, author of the very first commit should be fixed manually.
I think, Git allows only for one author in commit field, so historical information about authors shouldn't be removed from commit messages.