# git-cherry-pick and author field in version 1.7.6.4

7 messages from 2011-10-05 to 2011-10-06. Participants: Nicolas Dichtel, Jeff King.
Thread: https://gitlist.dev/t/28590

## Nicolas Dichtel, 2011-10-05 14:51

Subject: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <4E8C6F0E.7000508@6wind.com>
URL: https://gitlist.dev/e/4E8C6F0E.7000508%406wind.com

```
Hi all,

in the last stable version (1.7.6.4), when I perform a git-cherry-pick, the 
initial author of the patch is erased whith my name (it was not the case in 
version 1.7.3.4 and prior). Is this behavior intended ? Is there an option to 
keep the initial author of the patch?


Regards,
Nicolas

```

## Jeff King, 2011-10-05 17:41

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <20111005174138.GA22962@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20111005174138.GA22962%40sigill.intra.peff.net
In-Reply-To: <4E8C6F0E.7000508@6wind.com>

```
On Wed, Oct 05, 2011 at 04:51:58PM +0200, Nicolas Dichtel wrote:

> in the last stable version (1.7.6.4), when I perform a
> git-cherry-pick, the initial author of the patch is erased whith my
> name (it was not the case in version 1.7.3.4 and prior). Is this
> behavior intended ? Is there an option to keep the initial author of
> the patch?

I can't reproduce your problem:

  git init repo &&
  cd repo &&
  echo content >file && git add file && git commit -m base &&
  echo changes >>file &&
  git commit --author='Other Person <other@example.com>' -a -m other &&
  git tag other &&
  git reset --hard HEAD^ &&
  git cherry-pick other

gives this output for the cherry-pick:

  [master 6eb207f] other
   Author: Other Person <other@example.com>
   1 files changed, 1 insertions(+), 0 deletions(-)

and the resulting commit looks good:

  $ git log -1 --format='%an <%ae>'
  Other Person <other@example.com>

Does the script above work for you? If so, then what is different about
your problematic case?

-Peff

```

## Nicolas Dichtel, 2011-10-06 07:51

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <4E8D5DEA.9010500@6wind.com>
URL: https://gitlist.dev/e/4E8D5DEA.9010500%406wind.com
In-Reply-To: <20111005174138.GA22962@sigill.intra.peff.net>

```
Le 05/10/2011 19:41, Jeff King a écrit :
> On Wed, Oct 05, 2011 at 04:51:58PM +0200, Nicolas Dichtel wrote:
>
>> in the last stable version (1.7.6.4), when I perform a
>> git-cherry-pick, the initial author of the patch is erased whith my
>> name (it was not the case in version 1.7.3.4 and prior). Is this
>> behavior intended ? Is there an option to keep the initial author of
>> the patch?
>
> I can't reproduce your problem:
>
>    git init repo&&
>    cd repo&&
>    echo content>file&&  git add file&&  git commit -m base&&
>    echo changes>>file&&
>    git commit --author='Other Person<other@example.com>' -a -m other&&
>    git tag other&&
>    git reset --hard HEAD^&&
>    git cherry-pick other
>
> gives this output for the cherry-pick:
>
>    [master 6eb207f] other
>     Author: Other Person<other@example.com>
>     1 files changed, 1 insertions(+), 0 deletions(-)
>
> and the resulting commit looks good:
>
>    $ git log -1 --format='%an<%ae>'
>    Other Person<other@example.com>
>
> Does the script above work for you? If so, then what is different about
> your problematic case?
Here is my sequence. I'm in a linux tree with a remote that point to linus tree 
and I want to cherry-pick a patch from this remote:

# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 87ce387] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
# git log -1 --format='%an<%ae>'
Nicolas Dichtel<nicolas.dichtel@6wind.com>
# git log -1 --format='%an<%ae>' 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
Neil Jones<NeilJay@gmail.com>
#

Maybe it is related to the problem I've reported in another thread:
http://comments.gmane.org/gmane.comp.version-control.git/182853


Regards,
Nicolas

```

## Jeff King, 2011-10-06 11:27

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <20111006112742.GA4445@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20111006112742.GA4445%40sigill.intra.peff.net
In-Reply-To: <4E8D5DEA.9010500@6wind.com>

```
On Thu, Oct 06, 2011 at 09:51:06AM +0200, Nicolas Dichtel wrote:

> Here is my sequence. I'm in a linux tree with a remote that point to
> linus tree and I want to cherry-pick a patch from this remote:
> 
> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
> [dev 87ce387] drivers/net/usb/asix.c: Fix unaligned accesses
>  1 files changed, 33 insertions(+), 1 deletions(-)
> # git log -1 --format='%an<%ae>'
> Nicolas Dichtel<nicolas.dichtel@6wind.com>
> # git log -1 --format='%an<%ae>' 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
> Neil Jones<NeilJay@gmail.com>
> #

Hmph. Odd:

  $ cd linux-2.6
  $ git checkout -b dev 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9^
  Switched to a new branch 'dev'
  $ git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
  [dev 78929c2] drivers/net/usb/asix.c: Fix unaligned accesses
   Author: Neil Jones <NeilJay@gmail.com>
   1 files changed, 33 insertions(+), 1 deletions(-)
  $ git log -1 --format='%an <%ae>'
  Neil Jones <NeilJay@gmail.com>

> Maybe it is related to the problem I've reported in another thread:
> http://comments.gmane.org/gmane.comp.version-control.git/182853

Possibly. That issue is about the commit that comes _after_ the
cherry-pick, and in this instance, things are already wrong for you by
the time the cherry-pick has completed.

However, the problem has to do with leaving a stale state file in .git,
so perhaps a previous partially-completed cherry-pick has left cruft in
.git that is confusing this cherry-pick (i.e., I can't reproduce because
it is being affected by something that happened before the commands
above). So let's see what Jay comes up with for solving the other
problem, and I suspect it may just fix this issue, too.

You might also repeating the commands above. If it still fails, maybe
try removing ".git/CHERRY_PICK_HEAD" if it exists and see if that helps.

-Peff

```

## Nicolas Dichtel, 2011-10-06 12:37

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <4E8DA0EE.50208@6wind.com>
URL: https://gitlist.dev/e/4E8DA0EE.50208%406wind.com
In-Reply-To: <20111006112742.GA4445@sigill.intra.peff.net>

```
Le 06/10/2011 13:27, Jeff King a écrit :
> On Thu, Oct 06, 2011 at 09:51:06AM +0200, Nicolas Dichtel wrote:
>
>> Here is my sequence. I'm in a linux tree with a remote that point to
>> linus tree and I want to cherry-pick a patch from this remote:
>>
>> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
>> [dev 87ce387] drivers/net/usb/asix.c: Fix unaligned accesses
>>   1 files changed, 33 insertions(+), 1 deletions(-)
>> # git log -1 --format='%an<%ae>'
>> Nicolas Dichtel<nicolas.dichtel@6wind.com>
>> # git log -1 --format='%an<%ae>' 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
>> Neil Jones<NeilJay@gmail.com>
>> #
>
> Hmph. Odd:
>
>    $ cd linux-2.6
>    $ git checkout -b dev 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9^
>    Switched to a new branch 'dev'
>    $ git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
>    [dev 78929c2] drivers/net/usb/asix.c: Fix unaligned accesses
>     Author: Neil Jones<NeilJay@gmail.com>
>     1 files changed, 33 insertions(+), 1 deletions(-)
>    $ git log -1 --format='%an<%ae>'
>    Neil Jones<NeilJay@gmail.com>
# git checkout -b dev 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9^
Checking out files: 100% (25721/25721), done.
Switched to a new branch 'dev'
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 693df4c] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
# git log -1 --format='%an<%ae>'
Nicolas Dichtel<nicolas.dichtel@6wind.com>
#

>
>> Maybe it is related to the problem I've reported in another thread:
>> http://comments.gmane.org/gmane.comp.version-control.git/182853
>
> Possibly. That issue is about the commit that comes _after_ the
> cherry-pick, and in this instance, things are already wrong for you by
> the time the cherry-pick has completed.
>
> However, the problem has to do with leaving a stale state file in .git,
> so perhaps a previous partially-completed cherry-pick has left cruft in
> .git that is confusing this cherry-pick (i.e., I can't reproduce because
> it is being affected by something that happened before the commands
> above). So let's see what Jay comes up with for solving the other
> problem, and I suspect it may just fix this issue, too.
I think so too. Will wait.

>
> You might also repeating the commands above. If it still fails, maybe
> try removing ".git/CHERRY_PICK_HEAD" if it exists and see if that helps.
No, it just allow the commit --amend, but this will not change the author.


Regards,
Nicolas

```

## Jeff King, 2011-10-06 13:26

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <20111006132646.GB1792@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20111006132646.GB1792%40sigill.intra.peff.net
In-Reply-To: <4E8DA0EE.50208@6wind.com>

```
On Thu, Oct 06, 2011 at 02:37:02PM +0200, Nicolas Dichtel wrote:

> >>Maybe it is related to the problem I've reported in another thread:
> >>http://comments.gmane.org/gmane.comp.version-control.git/182853
> >
> >Possibly. That issue is about the commit that comes _after_ the
> >cherry-pick, and in this instance, things are already wrong for you by
> >the time the cherry-pick has completed.
> >
> >However, the problem has to do with leaving a stale state file in .git,
> >so perhaps a previous partially-completed cherry-pick has left cruft in
> >.git that is confusing this cherry-pick (i.e., I can't reproduce because
> >it is being affected by something that happened before the commands
> >above). So let's see what Jay comes up with for solving the other
> >problem, and I suspect it may just fix this issue, too.
> I think so too. Will wait.

Since you can reproduce this so readily, and since you said it seems to
work with older versions of git, you might try bisecting. There's a
reasonable chance it will just end up at Jay's CHERRY_PICK_HEAD commit,
but it might be worth doing.

-Peff

```

## Nicolas Dichtel, 2011-10-06 13:34

Subject: Re: git-cherry-pick and author field in version 1.7.6.4
Message-ID: <4E8DAE57.60705@6wind.com>
URL: https://gitlist.dev/e/4E8DAE57.60705%406wind.com
In-Reply-To: <20111006132646.GB1792@sigill.intra.peff.net>

```
Le 06/10/2011 15:26, Jeff King a écrit :
> On Thu, Oct 06, 2011 at 02:37:02PM +0200, Nicolas Dichtel wrote:
>
>>>> Maybe it is related to the problem I've reported in another thread:
>>>> http://comments.gmane.org/gmane.comp.version-control.git/182853
>>>
>>> Possibly. That issue is about the commit that comes _after_ the
>>> cherry-pick, and in this instance, things are already wrong for you by
>>> the time the cherry-pick has completed.
>>>
>>> However, the problem has to do with leaving a stale state file in .git,
>>> so perhaps a previous partially-completed cherry-pick has left cruft in
>>> .git that is confusing this cherry-pick (i.e., I can't reproduce because
>>> it is being affected by something that happened before the commands
>>> above). So let's see what Jay comes up with for solving the other
>>> problem, and I suspect it may just fix this issue, too.
>> I think so too. Will wait.
>
> Since you can reproduce this so readily, and since you said it seems to
> work with older versions of git, you might try bisecting. There's a
> reasonable chance it will just end up at Jay's CHERRY_PICK_HEAD commit,
> but it might be worth doing.
I've try with another user on the same host and it works, so I end up to my 
environment config ... and it's my fault: I've some variables set (GITPERLLIB 
and GIT_EXEC_PATH) that point to an older git version.
Now it works, sorry for the noise!

The second pb, about the author is fixed too.

Regards,
Nicolas

```
