git-cherry-pick and git-commit --amend in version 1.7.6.4

7 messages, 2 authors, 2016-06-15 · open the first message on its own page

git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Nicolas Dichtel <hidden>
Date: 2016-06-15 22:52:11

Hi,

still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I cannot do 
a commit --amend after:

# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
# echo $?
0
# git commit --amend
fatal: You are in the middle of a cherry-pick -- cannot amend.
#

The same operations (with the same patch), with version 1.7.3.4 is ok.


Regards,
Nicolas

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Jay Soffian <hidden>
Date: 2016-06-15 22:52:11

On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel
[off-list ref] wrote:
Hi,

still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I
cannot do a commit --amend after:

# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses
 1 files changed, 33 insertions(+), 1 deletions(-)
# echo $?
0
# git commit --amend
fatal: You are in the middle of a cherry-pick -- cannot amend.
#

The same operations (with the same patch), with version 1.7.3.4 is ok.
Please do the following with 1.7.6.4:

# ls .git
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# ls .git
# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# git cat-file -p HEAD

And send the transcript.

Thanks.

j.

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Nicolas Dichtel <hidden>
Date: 2016-06-15 22:52:11

Le 05/10/2011 18:50, Jay Soffian a écrit :
On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel
[off-list ref]  wrote:
quoted
Hi,

still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I
cannot do a commit --amend after:

# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
# echo $?
0
# git commit --amend
fatal: You are in the middle of a cherry-pick -- cannot amend.
#

The same operations (with the same patch), with version 1.7.3.4 is ok.
Please do the following with 1.7.6.4:

# ls .git
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# ls .git
# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# git cat-file -p HEAD

And send the transcript.
Here is:

# ls .git
branches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks  index 
info  logs  objects  ORIG_HEAD  packed-refs  refs
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
# ls .git
branches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD 
HEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs
# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
tree f29742a1a73c27a88c7ac701a7a06ac1c2f7973a
parent e7a3af5d8cd782b84e6ca4e4dcc8613be1a809f0
author Neil Jones [off-list ref] 1274141908 -0700
committer David S. Miller [off-list ref] 1274141908 -0700

drivers/net/usb/asix.c: Fix unaligned accesses

Using this driver can cause unaligned accesses in the IP layer
This has been fixed by aligning the skb data correctly using the
spare room left over by the 4 byte header inserted between packets
by the device.

Signed-off-by: Neil Jones <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
# git cat-file -p HEAD
tree 282b6492d9d5bcf1c3718420c6f31ca2033ca5cb
parent c8054f854773e65d8592f2ef35939ec2ae8b01df
author Nicolas Dichtel [off-list ref] 1317886553 +0200
committer Nicolas Dichtel [off-list ref] 1317886553 +0200

drivers/net/usb/asix.c: Fix unaligned accesses

Using this driver can cause unaligned accesses in the IP layer
This has been fixed by aligning the skb data correctly using the
spare room left over by the 4 byte header inserted between packets
by the device.

Signed-off-by: Neil Jones <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
#


Regards,
Nicolas

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Nicolas Dichtel <hidden>
Date: 2016-06-15 22:52:11

Le 06/10/2011 09:37, Nicolas Dichtel a écrit :
Le 05/10/2011 18:50, Jay Soffian a écrit :
quoted
On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel
[off-list ref] wrote:
quoted
Hi,

still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I
cannot do a commit --amend after:

# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses
1 files changed, 33 insertions(+), 1 deletions(-)
# echo $?
0
# git commit --amend
fatal: You are in the middle of a cherry-pick -- cannot amend.
#

The same operations (with the same patch), with version 1.7.3.4 is ok.
Please do the following with 1.7.6.4:

# ls .git
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# ls .git
# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
# git cat-file -p HEAD

And send the transcript.
Here is:

# ls .git
branches COMMIT_EDITMSG config description FETCH_HEAD HEAD hooks index info logs
objects ORIG_HEAD packed-refs refs
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses
1 files changed, 33 insertions(+), 1 deletions(-)
# ls .git
branches CHERRY_PICK_HEAD COMMIT_EDITMSG config description FETCH_HEAD HEAD
hooks index info logs objects ORIG_HEAD packed-refs refs
# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
tree f29742a1a73c27a88c7ac701a7a06ac1c2f7973a
parent e7a3af5d8cd782b84e6ca4e4dcc8613be1a809f0
author Neil Jones [off-list ref] 1274141908 -0700
committer David S. Miller [off-list ref] 1274141908 -0700

drivers/net/usb/asix.c: Fix unaligned accesses

Using this driver can cause unaligned accesses in the IP layer
This has been fixed by aligning the skb data correctly using the
spare room left over by the 4 byte header inserted between packets
by the device.

Signed-off-by: Neil Jones <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
# git cat-file -p HEAD
tree 282b6492d9d5bcf1c3718420c6f31ca2033ca5cb
parent c8054f854773e65d8592f2ef35939ec2ae8b01df
author Nicolas Dichtel [off-list ref] 1317886553 +0200
committer Nicolas Dichtel [off-list ref] 1317886553 +0200

drivers/net/usb/asix.c: Fix unaligned accesses

Using this driver can cause unaligned accesses in the IP layer
This has been fixed by aligning the skb data correctly using the
spare room left over by the 4 byte header inserted between packets
by the device.

Signed-off-by: Neil Jones <redacted>
Signed-off-by: David S. Miller <davem@davemloft.net>
#
There is another symptom, describe in this thread:
http://comments.gmane.org/gmane.comp.version-control.git/182852

Maybe the two problems are related.


Regards,
Nicolas

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Jay Soffian <hidden>
Date: 2016-06-15 22:52:11

On Thu, Oct 6, 2011 at 3:37 AM, Nicolas Dichtel
[off-list ref] wrote:
# ls .git
branches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks
 index info  logs  objects  ORIG_HEAD  packed-refs  refs
No CHERRY_PICK_HEAD, so far so good.
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses
 1 files changed, 33 insertions(+), 1 deletions(-)
cherry-pick completes successfully.
# ls .git
branches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD
HEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs
This is bad. CHERRY_PICK_HEAD should only exist if the cherry-pick failed.

I really don't know what could cause this. Possibly a hook in your repo?

Using "GIT_TRACE=1 git cherry-pick
3f78d1f210ff89af77f042ab7f4a8fee39feb1c9" will tell you whether git is
running any hooks.

I can't think of anything config-wise that would cause this behavior.

I'll peer at the code some more...

j.

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Nicolas Dichtel <hidden>
Date: 2016-06-15 22:52:11

Le 06/10/2011 15:09, Jay Soffian a écrit :
On Thu, Oct 6, 2011 at 3:37 AM, Nicolas Dichtel
[off-list ref]  wrote:
quoted
# ls .git
branches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks
  index info  logs  objects  ORIG_HEAD  packed-refs  refs
No CHERRY_PICK_HEAD, so far so good.
quoted
# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
[dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
cherry-pick completes successfully.
quoted
# ls .git
branches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD
HEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs
This is bad. CHERRY_PICK_HEAD should only exist if the cherry-pick failed.

I really don't know what could cause this. Possibly a hook in your repo?
No hooks:
# ls .git/hooks/
applypatch-msg.sample  post-commit.sample   post-update.sample 
pre-commit.sample          pre-rebase.sample
commit-msg.sample      post-receive.sample  pre-applypatch.sample 
prepare-commit-msg.sample  update.sample
Using "GIT_TRACE=1 git cherry-pick
3f78d1f210ff89af77f042ab7f4a8fee39feb1c9" will tell you whether git is
running any hooks.
Here is the output:
# GIT_TRACE=1 git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
trace: built-in: git 'cherry-pick' '3f78d1f210ff89af77f042ab7f4a8fee39feb1c9'
trace: run_command: 'commit' '-n' '-F' '.git/MERGE_MSG'
trace: exec: 'git' 'commit' '-n' '-F' '.git/MERGE_MSG'
setup: git_dir: .git
setup: worktree: /home/dichtel/DEV/linux-2.6
setup: cwd: /home/dichtel/DEV/linux-2.6
setup: prefix: (null)
trace: built-in: git 'commit' '-n' '-F' '.git/MERGE_MSG'
[master 8372873] drivers/net/usb/asix.c: Fix unaligned accesses
  1 files changed, 33 insertions(+), 1 deletions(-)
#
I can't think of anything config-wise that would cause this behavior.
With a very basic config, the pb he still here:
cat ~/.gitconfig
[user]
         name = Nicolas Dichtel
         email = nicolas.dichtel@6wind.com

I will try to do some other tests.


Regards,
Nicolas

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From: Jay Soffian <hidden>
Date: 2016-06-15 22:52:11

On Thu, Oct 6, 2011 at 9:22 AM, Nicolas Dichtel
[off-list ref] wrote:
Here is the output:
# GIT_TRACE=1 git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
trace: built-in: git 'cherry-pick'
'3f78d1f210ff89af77f042ab7f4a8fee39feb1c9'
trace: run_command: 'commit' '-n' '-F' '.git/MERGE_MSG'
trace: exec: 'git' 'commit' '-n' '-F' '.git/MERGE_MSG'
setup: git_dir: .git
setup: worktree: /home/dichtel/DEV/linux-2.6
setup: cwd: /home/dichtel/DEV/linux-2.6
setup: prefix: (null)
trace: built-in: git 'commit' '-n' '-F' '.git/MERGE_MSG'
I have a theory that determine_whence() inside commit.c isn't finding
.git/CHERRY_PICK_HEAD:

	else if (file_exists(git_path("CHERRY_PICK_HEAD")))
		whence = FROM_CHERRY_PICK;

That would cause the mis-attributed cherry-picked commit. commit.c is
also responsible for removing CHERRY_PICK_HEAD, which is not happening
correctly:

	unlink(git_path("CHERRY_PICK_HEAD"));

Maybe git_path("CHERRY_PICK_HEAD") is returning something unexpected.
But the trace output looks fine.

Aside, I'm a little confused by the "setup:" output appearing above.
In 1.7.5 and later, it requires setting GIT_TRACE_SETUP=1 to appear,
but you reported you're having this problem with 1.7.6.4.

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help