# gitk bug: write commit to file takes commit message from previous commit

2 messages from 2014-09-03 to 2014-09-03. Participants: Chris Packham.
Thread: https://gitlist.dev/t/37476

## Chris Packham, 2014-09-03 05:22

Subject: gitk bug: write commit to file takes commit message from previous commit
Message-ID: <CAFOYHZAWnaQNcCDbS3-2zxacYaD=egwhCT7qAc1DorRZ3_Pe_Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAFOYHZAWnaQNcCDbS3-2zxacYaD%3DegwhCT7qAc1DorRZ3_Pe_Q%40mail.gmail.com

```
Hi Paul,

Just noticed something in the version of gitk included in git 2.0.3.

When I right click on a commit and select "write commit to file" the
resulting file has the diff from the selected commit but the commit
message from the previous commit.

Attached is an example from running gitk on gitk
(git://ozlabs.org/~paulus/gitk). As you can see the author, sha1 and
diff are from 09898e7 but the message is from d4ec30b2.

I haven't tried bleeding edge gitk or bisecting yet. I'll let you know
if I can track this down to a specific change.

Thanks,
Chris

```

## Chris Packham, 2014-09-03 05:47

Subject: Re: gitk bug: write commit to file takes commit message from previous commit
Message-ID: <CAFOYHZDtaLEcdOSGA8h99rDTUzsn9z7JytgFLi-WGzZ525QkvQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFOYHZDtaLEcdOSGA8h99rDTUzsn9z7JytgFLi-WGzZ525QkvQ%40mail.gmail.com
In-Reply-To: <CAFOYHZAWnaQNcCDbS3-2zxacYaD=egwhCT7qAc1DorRZ3_Pe_Q@mail.gmail.com>

```
On Wed, Sep 3, 2014 at 5:22 PM, Chris Packham <judge.packham@gmail.com> wrote:
> Hi Paul,
>
> Just noticed something in the version of gitk included in git 2.0.3.
>
> When I right click on a commit and select "write commit to file" the
> resulting file has the diff from the selected commit but the commit
> message from the previous commit.
>
> Attached is an example from running gitk on gitk
> (git://ozlabs.org/~paulus/gitk). As you can see the author, sha1 and
> diff are from 09898e7 but the message is from d4ec30b2.
>
> I haven't tried bleeding edge gitk or bisecting yet. I'll let you know
> if I can track this down to a specific change.

Actually I don't think it's a gitk problem. If I run

  git diff-tree --stdin -p --pretty << EOF | less
  09898e7c3b040086e8addd4ef226548c9dce1460
  EOF

I get the wrong commit message. Looking at the release notes this has
already been fixed in 2.0.4. Sorry for the noise.

```
