# Editing Git Log

4 messages from 2008-09-18 to 2008-09-18. Participants: Piet Delaney, Boaz Harrosh, Matthias Kestenholz, Björn Steinbrink.
Thread: https://gitlist.dev/t/15571

## Piet Delaney, 2008-09-18 05:52

Subject: Editing Git Log
Message-ID: <48D1ECB4.9080808@tensilica.com>
URL: https://gitlist.dev/e/48D1ECB4.9080808%40tensilica.com

```
I think I recall reading that a feature of git was the prevention of the 
git commits
from being changed. I noticed today that a couple of us have checked in 
files
without our customary [XTENSA] architecture prefixed to the 1st line of our
Commit Messages.

I couldn't find a way to do this, other than our reverting back to a 
earlier repository
and recommitting (each?) change with the slightly changed Commit Message;
not an attractive investment of our time.

Any suggestions?

-piet

```

## Boaz Harrosh, 2008-09-18 06:13

Subject: Re: Editing Git Log
Message-ID: <48D1F19E.60907@panasas.com>
URL: https://gitlist.dev/e/48D1F19E.60907%40panasas.com
In-Reply-To: <48D1ECB4.9080808@tensilica.com>

```
Piet Delaney wrote:
> I think I recall reading that a feature of git was the prevention of the 
> git commits
> from being changed. I noticed today that a couple of us have checked in 
> files
> without our customary [XTENSA] architecture prefixed to the 1st line of our
> Commit Messages.
> 
> I couldn't find a way to do this, other than our reverting back to a 
> earlier repository
> and recommitting (each?) change with the slightly changed Commit Message;
> not an attractive investment of our time.
> 
> Any suggestions?
> 
> -piet
> --

git rebase --interactive FIRST_BAD_COMMIT^ will effectively do the same
as above but in a nice automated way. Just change pick => edit on these
patches that need fixing, you'll see.

Boaz

```

## Björn Steinbrink, 2008-09-18 06:21

Subject: Re: Editing Git Log
Message-ID: <20080918062116.GB32670@atjola.homenet>
URL: https://gitlist.dev/e/20080918062116.GB32670%40atjola.homenet
In-Reply-To: <48D1F19E.60907@panasas.com>

```
On 2008.09.18 09:13:50 +0300, Boaz Harrosh wrote:
> Piet Delaney wrote:
> > I think I recall reading that a feature of git was the prevention of the 
> > git commits
> > from being changed. I noticed today that a couple of us have checked in 
> > files
> > without our customary [XTENSA] architecture prefixed to the 1st line of our
> > Commit Messages.
> > 
> > I couldn't find a way to do this, other than our reverting back to a 
> > earlier repository
> > and recommitting (each?) change with the slightly changed Commit Message;
> > not an attractive investment of our time.
> > 
> > Any suggestions?
> > 
> > -piet
> > --
> 
> git rebase --interactive FIRST_BAD_COMMIT^ will effectively do the same
> as above but in a nice automated way. Just change pick => edit on these
> patches that need fixing, you'll see.

git filter-branch with a suited msg-filter is even more automated :-)

Björn

```

## Matthias Kestenholz, 2008-09-18 06:21

Subject: Re: Editing Git Log
Message-ID: <1f6632e50809172321y6343a3aau27e2ecd719185060@mail.gmail.com>
URL: https://gitlist.dev/e/1f6632e50809172321y6343a3aau27e2ecd719185060%40mail.gmail.com
In-Reply-To: <48D1ECB4.9080808@tensilica.com>

```
On Thu, Sep 18, 2008 at 7:52 AM, Piet Delaney
<piet.delaney@tensilica.com> wrote:
> I think I recall reading that a feature of git was the prevention of the git
> commits
> from being changed. I noticed today that a couple of us have checked in
> files
> without our customary [XTENSA] architecture prefixed to the 1st line of our
> Commit Messages.
>
> I couldn't find a way to do this, other than our reverting back to a earlier
> repository
> and recommitting (each?) change with the slightly changed Commit Message;
> not an attractive investment of our time.
>
> Any suggestions?
>

You have to create new commits, but you do not have to do it by hand. See
filter-branch[1]

The example given in the manpage removes the git-svn identifiers:

git filter-branch --msg-filter '
        sed -e "/^git-svn-id:/d"
'

You can probably modify the sed expression and use it nearly as is (of course
you would not want to filter the whole history, only the handful commits that
came from you or your team.

[1]: http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html

```
