# Cleaning up log messages

10 messages from 2008-07-27 to 2008-07-27. Participants: Jon Smirl, Johannes Schindelin, Petr Baudis, Junio C Hamano.
Thread: https://gitlist.dev/t/14707

## Jon Smirl, 2008-07-27 17:50

Subject: Cleaning up log messages
Message-ID: <9e4733910807271050y7fb5f77coec05bd68421baaab@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910807271050y7fb5f77coec05bd68421baaab%40mail.gmail.com

```
I was playing around with git log for the kernel and observed that
there is a lot of noise when trying to do statistics on the number of
commits.

For example:

Author: Greg K-H <gregkh@suse.de>
Author: Greg KH <gregkh@suse.de>
Author: Greg KH <greg@kroah.com>
Author: Greg KH <greg@press.(none)>
Author: gregkh@suse.de <gregkh@suse.de>
Author: Greg Kroah-Hartman <gregkh@suse>
Author: Greg Kroah-Hartman <gregkh@suse.de>
Author: Greg Kroah-Hartman <greg@kroah.com>

I don't see an obvious way to do this with git, but it would be neat
to have a 'clean' option on git log that would take each email address
(author, signed-off, acked, etc) and map it through a table which
would convert old email addresses in to the current one and also
standardize the formatting of the names. A cleaned log would be
altered on display, but just don't clean it if you want the original.

Of course this initial map would need to be built by hand. New commits
could be checked against the map and the mapped updated if the person
really has a new email address. Checking new commits against the map
would help clean things up going forward. checkpatch.pl could also
validate against the mapping file.

No pressing need to for this, it would just be a nice toy.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Johannes Schindelin, 2008-07-27 18:01

Subject: Re: Cleaning up log messages
Message-ID: <alpine.DEB.1.00.0807272000270.5526@eeepc-johanness>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0807272000270.5526%40eeepc-johanness
In-Reply-To: <9e4733910807271050y7fb5f77coec05bd68421baaab@mail.gmail.com>

```
Hi,

On Sun, 27 Jul 2008, Jon Smirl wrote:

> I was playing around with git log for the kernel and observed that there 
> is a lot of noise when trying to do statistics on the number of commits.
> 
> For example:
> 
> Author: Greg K-H <gregkh@suse.de>
> Author: Greg KH <gregkh@suse.de>
> Author: Greg KH <greg@kroah.com>
> Author: Greg KH <greg@press.(none)>
> Author: gregkh@suse.de <gregkh@suse.de>
> Author: Greg Kroah-Hartman <gregkh@suse>
> Author: Greg Kroah-Hartman <gregkh@suse.de>
> Author: Greg Kroah-Hartman <greg@kroah.com>
> 
> I don't see an obvious way to do this with git, but it would be neat
> to have a 'clean' option on git log that would take each email address
> (author, signed-off, acked, etc) and map it through a table which
> would convert old email addresses in to the current one and also
> standardize the formatting of the names.

Something like .mailmap?

And to show the mapped author name instead of the committed one, you would 
use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)

Ciao,
Dscho

```

## Jon Smirl, 2008-07-27 18:16

Subject: Re: Cleaning up log messages
Message-ID: <9e4733910807271116q29323664l8d44fdded1de8c8e@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910807271116q29323664l8d44fdded1de8c8e%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0807272000270.5526@eeepc-johanness>

```
On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
>
>  On Sun, 27 Jul 2008, Jon Smirl wrote:
>
>  > I was playing around with git log for the kernel and observed that there
>  > is a lot of noise when trying to do statistics on the number of commits.
>  >
>  > For example:
>  >
>  > Author: Greg K-H <gregkh@suse.de>
>  > Author: Greg KH <gregkh@suse.de>
>  > Author: Greg KH <greg@kroah.com>
>  > Author: Greg KH <greg@press.(none)>
>  > Author: gregkh@suse.de <gregkh@suse.de>
>  > Author: Greg Kroah-Hartman <gregkh@suse>
>  > Author: Greg Kroah-Hartman <gregkh@suse.de>
>  > Author: Greg Kroah-Hartman <greg@kroah.com>
>  >
>  > I don't see an obvious way to do this with git, but it would be neat
>  > to have a 'clean' option on git log that would take each email address
>  > (author, signed-off, acked, etc) and map it through a table which
>  > would convert old email addresses in to the current one and also
>  > standardize the formatting of the names.
>
>
> Something like .mailmap?
>
>  And to show the mapped author name instead of the committed one, you would
>  use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)

So we can already do this? Where is a .mailmap for the kernel tree?

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Petr Baudis, 2008-07-27 18:33

Subject: Re: Cleaning up log messages
Message-ID: <20080727183309.GD32184@machine.or.cz>
URL: https://gitlist.dev/e/20080727183309.GD32184%40machine.or.cz
In-Reply-To: <9e4733910807271116q29323664l8d44fdded1de8c8e@mail.gmail.com>

```
On Sun, Jul 27, 2008 at 02:16:30PM -0400, Jon Smirl wrote:
> On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Something like .mailmap?
> >
> >  And to show the mapped author name instead of the committed one, you would
> >  use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)
> 
> So we can already do this? Where is a .mailmap for the kernel tree?

	http://repo.or.cz/w/linux-2.6.git?a=blob;f=.mailmap

...right there. :-)

				Petr "Pasky" Baudis

```

## Junio C Hamano, 2008-07-27 18:47

Subject: Re: Cleaning up log messages
Message-ID: <7vsktv17wc.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vsktv17wc.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <9e4733910807271050y7fb5f77coec05bd68421baaab@mail.gmail.com>

```
"Jon Smirl" <jonsmirl@gmail.com> writes:

> I was playing around with git log for the kernel and observed that
> there is a lot of noise when trying to do statistics on the number of
> commits.
>
> For example:
>
> Author: Greg K-H <gregkh@suse.de>
> Author: Greg KH <gregkh@suse.de>
> ...
> Author: Greg Kroah-Hartman <greg@kroah.com>

We have had .mailmap since a24e658 (git-shortlog: make the mailmap
configurable., 2005-10-06); maybe the kernel tree wants a maintainer for
the .mailmap file?

```

## Jon Smirl, 2008-07-27 19:07

Subject: Re: Cleaning up log messages
Message-ID: <9e4733910807271207o2e18cef1h869c659bd0ae31ba@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910807271207o2e18cef1h869c659bd0ae31ba%40mail.gmail.com
In-Reply-To: <20080727183309.GD32184@machine.or.cz>

```
On 7/27/08, Petr Baudis <pasky@suse.cz> wrote:
> On Sun, Jul 27, 2008 at 02:16:30PM -0400, Jon Smirl wrote:
>  > On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > > Something like .mailmap?
>  > >
>  > >  And to show the mapped author name instead of the committed one, you would
>  > >  use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)
>  >
>  > So we can already do this? Where is a .mailmap for the kernel tree?
>
>
>         http://repo.or.cz/w/linux-2.6.git?a=blob;f=.mailmap
>
>  ...right there. :-)

I updated to 1.6.0-rc0 and this is working. mailmap needs some
cleanup. Errors are still in the list, but this is a lot better than
it was. That made about 800 'contributors' disappear.

Is there a way to do short log and have it map the names? What about
replacing the emails with their current email address?

Random missing entries....
Greg KH
Greg Kroah-Hartman

Hans J Koch
Hans J. Koch

Jean-Christophe Dubois
Jean-Christophe DUBOIS

Miguel Boton
Miguel Botón

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Johannes Schindelin, 2008-07-27 19:20

Subject: Re: Cleaning up log messages
Message-ID: <alpine.DEB.1.00.0807272116030.5526@eeepc-johanness>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0807272116030.5526%40eeepc-johanness
In-Reply-To: <9e4733910807271207o2e18cef1h869c659bd0ae31ba@mail.gmail.com>

```
Hi,

On Sun, 27 Jul 2008, Jon Smirl wrote:

> On 7/27/08, Petr Baudis <pasky@suse.cz> wrote:
> > On Sun, Jul 27, 2008 at 02:16:30PM -0400, Jon Smirl wrote:
> >  > On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >
> > > > Something like .mailmap?
> >  > >
> >  > >  And to show the mapped author name instead of the committed one, you would
> >  > >  use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)
> >  >
> >  > So we can already do this? Where is a .mailmap for the kernel tree?
> >
> >         http://repo.or.cz/w/linux-2.6.git?a=blob;f=.mailmap
> >
> >  ...right there. :-)
> 
> I updated to 1.6.0-rc0 and this is working. mailmap needs some
> cleanup. Errors are still in the list, but this is a lot better than
> it was. That made about 800 'contributors' disappear.
> 
> Is there a way to do short log and have it map the names?

Yes, as of v1.6.0-rc0~58 you can pass --pretty=format: to shortlog.

> What about replacing the emails with their current email address?

Nope, that was never meant to be done.

Ciao,
Dscho

```

## Jon Smirl, 2008-07-27 19:31

Subject: Re: Cleaning up log messages
Message-ID: <9e4733910807271231s7ff6acf8rf5848cc1a31f3afc@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910807271231s7ff6acf8rf5848cc1a31f3afc%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0807272116030.5526@eeepc-johanness>

```
On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
>
>  On Sun, 27 Jul 2008, Jon Smirl wrote:
>
>  > On 7/27/08, Petr Baudis <pasky@suse.cz> wrote:
>  > > On Sun, Jul 27, 2008 at 02:16:30PM -0400, Jon Smirl wrote:
>  > >  > On 7/27/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>  > >
>  > > > > Something like .mailmap?
>  > >  > >
>  > >  > >  And to show the mapped author name instead of the committed one, you would
>  > >  > >  use "--pretty=format:%aN"?  (Needs 1.6.0-rc0 at least, IIRC)
>  > >  >
>  > >  > So we can already do this? Where is a .mailmap for the kernel tree?
>  > >
>  > >         http://repo.or.cz/w/linux-2.6.git?a=blob;f=.mailmap
>  > >
>  > >  ...right there. :-)
>  >
>  > I updated to 1.6.0-rc0 and this is working. mailmap needs some
>  > cleanup. Errors are still in the list, but this is a lot better than
>  > it was. That made about 800 'contributors' disappear.
>  >
>  > Is there a way to do short log and have it map the names?
>
>
> Yes, as of v1.6.0-rc0~58 you can pass --pretty=format: to shortlog.

How do you do it with git log? --pretty overrides the default of medium

--pretty[=<format>]

    Pretty-print the contents of the commit logs in a given format,
where <format> can be one of oneline, short, medium, full, fuller,
email, raw and format:<string>. When omitted, the format defaults to
medium.


>
>
>  > What about replacing the emails with their current email address?
>
>
> Nope, that was never meant to be done.
>
>  Ciao,
>  Dscho
>
>


-- 
Jon Smirl
jonsmirl@gmail.com

```

## Johannes Schindelin, 2008-07-27 20:16

Subject: Re: Cleaning up log messages
Message-ID: <alpine.DEB.1.00.0807272214120.5526@eeepc-johanness>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0807272214120.5526%40eeepc-johanness
In-Reply-To: <9e4733910807271231s7ff6acf8rf5848cc1a31f3afc@mail.gmail.com>

```
Hi,

On Sun, 27 Jul 2008, Jon Smirl wrote:

> How do you do it with git log? --pretty overrides the default of medium
> 
> --pretty[=<format>]
> 
>     Pretty-print the contents of the commit logs in a given format,
> where <format> can be one of oneline, short, medium, full, fuller,
> email, raw and format:<string>. When omitted, the format defaults to
> medium.

You get it _almost_ with

$ f='commit %H%nAuthor: %aN <%ae>%nDate:    %ad%n%n%s%n%n%b'
$ git log --pretty="format:$f"

The only difference being that the commit message is not indented.  If you 
really need that, it is easy to add.

But I rather doubt that you need it, as you want to make statistics, and 
therefore need to pipe the output into a script anyway.

Ciao,
Dscho

```

## Jon Smirl, 2008-07-27 20:52

Subject: Re: Cleaning up log messages
Message-ID: <9e4733910807271352h67044045y7576a719d4cc80cd@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910807271352h67044045y7576a719d4cc80cd%40mail.gmail.com
In-Reply-To: <7vsktv17wc.fsf@gitster.siamese.dyndns.org>

```
On 7/27/08, Junio C Hamano <gitster@pobox.com> wrote:
> "Jon Smirl" <jonsmirl@gmail.com> writes:
>
>  > I was playing around with git log for the kernel and observed that
>  > there is a lot of noise when trying to do statistics on the number of
>  > commits.
>  >
>  > For example:
>  >
>  > Author: Greg K-H <gregkh@suse.de>
>  > Author: Greg KH <gregkh@suse.de>
>  > ...
>
> > Author: Greg Kroah-Hartman <greg@kroah.com>
>
>
> We have had .mailmap since a24e658 (git-shortlog: make the mailmap
>  configurable., 2005-10-06); maybe the kernel tree wants a maintainer for
>  the .mailmap file?

This seems to be the main problem. There are so many missing entries
from the .mailmap file that I didn't think this feature was
implemented. I'd guestimate that 300-400 needed entries are missing.

I've made a few attempts at writing a script to fix the easy ones but
I don't have a good solution yet.

-- 
Jon Smirl
jonsmirl@gmail.com

```
