{"thread":{"id":"28591","subject":"git-cherry-pick and git-commit --amend in version 1.7.6.4","startedAt":"2011-10-05T14:52:31Z","lastAt":"2011-10-06T13:44:45Z","messageCount":16,"participants":["Nicolas Dichtel","Jay Soffian","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"176929","messageId":"4E8C6F2F.1070306@6wind.com","threadId":"28591","inReplyTo":null,"subject":"git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Nicolas Dichtel","fromEmail":"nicolas.dichtel@6wind.com","sentAt":"2011-10-05T14:52:31Z","receivedAt":"2011-10-05T14:52:31Z","isPatch":false,"sender":{"key":"nicolas.dichtel@6wind.com","avatar":null},"body":"Hi,\n\nstill with version 1.7.6.4, when I do a cherry-pick, that succeeded, I cannot do \na commit --amend after:\n\n# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n[dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses\n  1 files changed, 33 insertions(+), 1 deletions(-)\n# echo $?\n0\n# git commit --amend\nfatal: You are in the middle of a cherry-pick -- cannot amend.\n#\n\nThe same operations (with the same patch), with version 1.7.3.4 is ok.\n\n\nRegards,\nNicolas\n"},{"id":"176938","messageId":"CAG+J_DynqAK8uXDPtHwWpGhfA5qFZifucs91qL79Pu_DmCxG3g@mail.gmail.com","threadId":"28591","inReplyTo":"4E8C6F2F.1070306@6wind.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-05T16:50:06Z","receivedAt":"2011-10-05T16:50:06Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel\n<nicolas.dichtel@6wind.com> wrote:\n> Hi,\n>\n> still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I\n> cannot do a commit --amend after:\n>\n> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> [dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses\n>  1 files changed, 33 insertions(+), 1 deletions(-)\n> # echo $?\n> 0\n> # git commit --amend\n> fatal: You are in the middle of a cherry-pick -- cannot amend.\n> #\n>\n> The same operations (with the same patch), with version 1.7.3.4 is ok.\n\nPlease do the following with 1.7.6.4:\n\n# ls .git\n# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n# ls .git\n# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n# git cat-file -p HEAD\n\nAnd send the transcript.\n\nThanks.\n\nj.\n"},{"id":"176942","messageId":"7v8voz8hgq.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"4E8C6F2F.1070306@6wind.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-05T17:40:37Z","receivedAt":"2011-10-05T17:40:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pinging Jay who may have know a thing or two from the history leading to\n37f7a85 (Teach commit about CHERRY_PICK_HEAD, 2011-02-19).\n\nNicolas Dichtel <nicolas.dichtel@6wind.com> writes:\n\n> Hi,\n>\n> still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I\n> cannot do a commit --amend after:\n>\n> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> [dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses\n>  1 files changed, 33 insertions(+), 1 deletions(-)\n> # echo $?\n> 0\n> # git commit --amend\n> fatal: You are in the middle of a cherry-pick -- cannot amend.\n> #\n>\n> The same operations (with the same patch), with version 1.7.3.4 is ok.\n>\n>\n> Regards,\n> Nicolas\n"},{"id":"176945","messageId":"CAG+J_Dyn3kk7SfNZzxjoD-hK9jBQr2igmOqJojeYNHLubtSY=w@mail.gmail.com","threadId":"28591","inReplyTo":"7v8voz8hgq.fsf@alter.siamese.dyndns.org","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-05T17:43:19Z","receivedAt":"2011-10-05T17:43:19Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Oct 5, 2011 at 1:40 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Pinging Jay who may have know a thing or two from the history leading to\n> 37f7a85 (Teach commit about CHERRY_PICK_HEAD, 2011-02-19).\n\nYep, I replied to Nicolas' other message.\n\nj.\n"},{"id":"176968","messageId":"7vpqib5ciw.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"CAG+J_Dyn3kk7SfNZzxjoD-hK9jBQr2igmOqJojeYNHLubtSY=w@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-05T21:55:35Z","receivedAt":"2011-10-05T21:55:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Wed, Oct 5, 2011 at 1:40 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Pinging Jay who may have know a thing or two from the history leading to\n>> 37f7a85 (Teach commit about CHERRY_PICK_HEAD, 2011-02-19).\n>\n> Yep, I replied to Nicolas' other message.\n>\n> j.\n\nThis is probably different fro Nicolas's use case, but you can easily\ntrigger:\n\n $ edit foo.c\n $ EDITOR=: git commit --amend ;# forget to add foo.c\n $ git cherry-pick other\n error: Your local changes to the following files would be overwritten by\n merge:\n        foo.c\n Please, commit your changes or stash them before you can merge.\n Aborting\n $ EDITOR=: git commit --amend foo.c\n fatal: You are in the middle of a cherry-pick -- cannot amend.\n\nI think the sequencer state needs to be removed when the command aborts.\n\nThis needs to be fixed before 1.7.7.1.\n"},{"id":"176972","messageId":"CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com","threadId":"28591","inReplyTo":"7vpqib5ciw.fsf@alter.siamese.dyndns.org","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-05T22:23:36Z","receivedAt":"2011-10-05T22:23:36Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Oct 5, 2011 at 5:55 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> I think the sequencer state needs to be removed when the command aborts.\n\nOr written later in do_pick_commit().\n\n> This needs to be fixed before 1.7.7.1.\n\nSomething like this?\n\ndiff --git i/builtin/revert.c w/builtin/revert.c\nindex 3117776c2c..f7fcc88871 100644\n--- i/builtin/revert.c\n+++ w/builtin/revert.c\n@@ -384,6 +384,7 @@ static int do_pick_commit(void)\n \tchar *defmsg = NULL;\n \tstruct strbuf msgbuf = STRBUF_INIT;\n \tint res;\n+\tint record_cherry_pick_head = 0;\n\n \tif (no_commit) {\n \t\t/*\n@@ -477,7 +478,7 @@ static int do_pick_commit(void)\n \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n \t\t}\n \t\tif (!no_commit)\n-\t\t\twrite_cherry_pick_head();\n+\t\t\trecord_cherry_pick_head = 1;\n \t}\n\n \tif (!strategy || !strcmp(strategy, \"recursive\") || action == REVERT) {\n@@ -514,6 +515,9 @@ static int do_pick_commit(void)\n \tfree_message(&msg);\n \tfree(defmsg);\n\n+\tif (record_cherry_pick_head)\n+\t\twrite_cherry_pick_head();\n+\n \treturn res;\n }\n"},{"id":"176973","messageId":"7vhb3n5asv.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-05T22:32:48Z","receivedAt":"2011-10-05T22:32:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Wed, Oct 5, 2011 at 5:55 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I think the sequencer state needs to be removed when the command aborts.\n>\n> Or written later in do_pick_commit().\n>\n>> This needs to be fixed before 1.7.7.1.\n>\n> Something like this?\n\nDoes it also refrain from creating sequencer state directory?\n\n> diff --git i/builtin/revert.c w/builtin/revert.c\n> index 3117776c2c..f7fcc88871 100644\n> --- i/builtin/revert.c\n> +++ w/builtin/revert.c\n> @@ -384,6 +384,7 @@ static int do_pick_commit(void)\n>  \tchar *defmsg = NULL;\n>  \tstruct strbuf msgbuf = STRBUF_INIT;\n>  \tint res;\n> +\tint record_cherry_pick_head = 0;\n>\n>  \tif (no_commit) {\n>  \t\t/*\n> @@ -477,7 +478,7 @@ static int do_pick_commit(void)\n>  \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n>  \t\t}\n>  \t\tif (!no_commit)\n> -\t\t\twrite_cherry_pick_head();\n> +\t\t\trecord_cherry_pick_head = 1;\n>  \t}\n>\n>  \tif (!strategy || !strcmp(strategy, \"recursive\") || action == REVERT) {\n> @@ -514,6 +515,9 @@ static int do_pick_commit(void)\n>  \tfree_message(&msg);\n>  \tfree(defmsg);\n>\n> +\tif (record_cherry_pick_head)\n> +\t\twrite_cherry_pick_head();\n> +\n>  \treturn res;\n>  }\n"},{"id":"176977","messageId":"7v62k359ee.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-05T23:03:05Z","receivedAt":"2011-10-05T23:03:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Wed, Oct 5, 2011 at 5:55 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I think the sequencer state needs to be removed when the command aborts.\n>\n> Or written later in do_pick_commit().\n\nAs a general direction, I think it makes tons of sense ot delay writing\nout these state files before you really commit that the user will be in\nthe cherry-pick (or revert) sequence.\n\nI am not sure if do_pick_commit() is the best place to do so. Wouldn't it\nbe necessary to special case the first round at least? The pick can fail\nin one of two ways:\n\n - It does not even start. This is the case I illustrated in the earlier\n   message, and we do not want to leave sequencer state.\n\n - It stops with conflict. At this point, it probably is OK to say that\n   the user is committed to go with the sequencer flow and the next step\n   would be to help Git resolve conflicts and proceed, and in this case we\n   do want the sequencer state.\n\nAnd once we picked/reverted at least one commit, if there are more, the\nuser knows the sequencer flow is in progress, and it is perfectly fine to\nsee the error message from \"commit --amend\".\n\nIt's just the \"commit --amend\" message that says I cannot amend felt\nutterly out of place, immediately after seeing \"cherry-pick\" that tried to\npick only one commit did _not_ even start.\n"},{"id":"176979","messageId":"7v1uur57l8.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"7v62k359ee.fsf@alter.siamese.dyndns.org","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-05T23:42:11Z","receivedAt":"2011-10-05T23:42:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> It's just the \"commit --amend\" message that says I cannot amend felt\n> utterly out of place, immediately after seeing \"cherry-pick\" that tried to\n> pick only one commit did _not_ even start.\n\nAfter thinking about it a bit more, I am starting to think that it may\njust be the error message given by \"commit --amend\".\n\nIf the sequence were like this:\n\n    $ edit foo.c ;# I want to fix foo.c in the current branch \"master\"\n    $ EDITOR=: git commit --amend ;# forgot to say \"foo.c\"\n    $ git cherry-pick other~2 other\n    [master 48882c9] frotz: update xyzzy\n     Author: Jay Soffian <jaysoffian@gmail.com>\n     1 files changed, 2 insertions(+), 2 deletions(-)\n    error: Your local changes to the following files would be overwritten by merge:\n            foo.c\n    Please, commit your changes or stash them before you can merge.\n    Aborting\n\nThen at this point, amending the commit at HEAD^ is not possible anyway,\nas it is not at the tip anymore.  It is perfectly fine that\n\n    $ git commit --amend foo.c\n\nfails at this point.\n\nIt is just that it initially felt irritatingly wrong if I was picking only\na single commit \"other\" that wanted to touch foo.c, like this:\n\n    $ edit foo.c ;# I want to fix foo.c in the current branch \"master\"\n    $ EDITOR=: git commit --amend ;# forgot to say \"foo.c\"\n    $ git cherry-pick other\n    error: Your local changes to the following files would be overwritten by merge:\n            foo.c\n    Please, commit your changes or stash them before you can merge.\n    Aborting\n\nAt this point, as it says \"Please commit your changes\", and it is very\nclear that cherry-pick _correctly_ errored out without touching any of my\nwork, it is natural for me to expect that I can \"commit --amend\" to fix\nmy eariler mistake.\n\n    $ EDITOR=: git commit --amend foo.c\n    fatal: You are in the middle of a cherry-pick -- cannot amend.\n\nThis can only worked around halfway:\n\n    $ rm .git/CHERRY_PICK_HEAD\n    $ EDITOR=: git commit --amend foo.c\n    \nThings look OK so far, but then restarting the cherry-pick I wanted to do\nafter I fixed foo.c would fail like this:\n\n    $ git cherry-pick other\n    error: .git/sequencer already exists.\n    error: A cherry-pick or revert is in progress.\n    hint: Use --continue to continue the operation\n    hint: or --reset to forget about it\n    fatal: cherry-pick failed\n\nPerhaps it would be a possible solution to teach \"cherry-pick --reset\" to\nremove CHERRY_PICK_HEAD and the sequencer state, so that the above\ntranscript would become:\n\n    $ edit foo.c ;# I want to fix foo.c in the current branch \"master\"\n    $ EDITOR=: git commit --amend ;# forgot to say \"foo.c\"\n    $ git cherry-pick other\n    error: Your local changes to the following files would be overwritten by merge:\n            foo.c\n    Please, commit your changes or stash them before you can merge.\n    Aborting\n    $ EDITOR=: git commit --amend foo.c\n    fatal: You are in the middle of a cherry-pick -- cannot amend.\n    hint: use \"git cherry-pick --reset\" to discard the previous cherry-pick.\n    $ git cherry-pick --reset\n    $ EDITOR=: git commit --amend foo.c\n    $ git cherry-pick other\n    [master 48882c9] frotz: update nitfol\n     Author: Jay Soffian <jaysoffian@gmail.com>\n     1 files changed, 2 insertions(+), 2 deletions(-)\n\nAt least, that looks like something we _could_ explain to the end users.\n"},{"id":"176981","messageId":"CAG+J_DxJ25bBo0=30+9r3+kwy+u4M9ZdihnctsMYis+zgbduEg@mail.gmail.com","threadId":"28591","inReplyTo":"7vhb3n5asv.fsf@alter.siamese.dyndns.org","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-06T00:08:38Z","receivedAt":"2011-10-06T00:08:38Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Oct 5, 2011 at 6:32 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Does it also refrain from creating sequencer state directory?\n\nI'm not familiar with the sequencer code. It's not in master is it?\n\nWhat's happening here is that do_pick_commit() was creating\nCHERRY_PICK_HEAD, but then git aborts several call sites away\n(do_recursive_merge -> merge_trees -> git_merge_trees -> unpack_trees\n-> display_error_msgs).\n\nSo I think do_pick_commit() needs to defer creating CHERRY_PICK_HEAD\ntill after the possible abort.\n\nI don't know if that's the right fix for next or not, but it seems\ncorrect for master.\n\nj.\n"},{"id":"177007","messageId":"7v39f638fr.fsf@alter.siamese.dyndns.org","threadId":"28591","inReplyTo":"CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-06T07:06:48Z","receivedAt":"2011-10-06T07:06:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> Something like this?\n>\n> diff --git i/builtin/revert.c w/builtin/revert.c\n> index 3117776c2c..f7fcc88871 100644\n> --- i/builtin/revert.c\n> +++ w/builtin/revert.c\n> @@ -384,6 +384,7 @@ static int do_pick_commit(void)\n>  \tchar *defmsg = NULL;\n>  \tstruct strbuf msgbuf = STRBUF_INIT;\n>  \tint res;\n> +\tint record_cherry_pick_head = 0;\n>\n>  \tif (no_commit) {\n>  \t\t/*\n> @@ -477,7 +478,7 @@ static int do_pick_commit(void)\n>  \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n>  \t\t}\n>  \t\tif (!no_commit)\n> -\t\t\twrite_cherry_pick_head();\n> +\t\t\trecord_cherry_pick_head = 1;\n>  \t}\n>\n>  \tif (!strategy || !strcmp(strategy, \"recursive\") || action == REVERT) {\n> @@ -514,6 +515,9 @@ static int do_pick_commit(void)\n>  \tfree_message(&msg);\n>  \tfree(defmsg);\n>\n> +\tif (record_cherry_pick_head)\n> +\t\twrite_cherry_pick_head();\n> +\n>  \treturn res;\n>  }\n\nI switched to \"maint\" to look at this patch in context without the\nsequencer complication.\n\nThe basic idea to delay writing the file feels sound, but when a conflict\nhappens, print_advice() runs and tries to clear CHERRY_PICK_HEAD, but you\nare then writing the file out much later than that at the end of the\nfunction.\n\nThis patch seems to break a few tests. t3404, t3506 and t3507 are among\nthem.\n\nAlso, if you are using the recursive strategy, a cherry-pick that did not\nstart would die() in do_recursive_merge(), and your hunk at -477,7 to\nremove call to write_cherry_head() would be sufficient, but if you are\nusing another strategy, then try_merge_command() would return with 2 and I\nthink you would want to skip it for the same reason in that case.\n"},{"id":"177008","messageId":"4E8D5AD0.2040509@6wind.com","threadId":"28591","inReplyTo":"CAG+J_DynqAK8uXDPtHwWpGhfA5qFZifucs91qL79Pu_DmCxG3g@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Nicolas Dichtel","fromEmail":"nicolas.dichtel@6wind.com","sentAt":"2011-10-06T07:37:52Z","receivedAt":"2011-10-06T07:37:52Z","isPatch":false,"sender":{"key":"nicolas.dichtel@6wind.com","avatar":null},"body":"Le 05/10/2011 18:50, Jay Soffian a écrit :\n> On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel\n> <nicolas.dichtel@6wind.com>  wrote:\n>> Hi,\n>>\n>> still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I\n>> cannot do a commit --amend after:\n>>\n>> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n>> [dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses\n>>   1 files changed, 33 insertions(+), 1 deletions(-)\n>> # echo $?\n>> 0\n>> # git commit --amend\n>> fatal: You are in the middle of a cherry-pick -- cannot amend.\n>> #\n>>\n>> The same operations (with the same patch), with version 1.7.3.4 is ok.\n>\n> Please do the following with 1.7.6.4:\n>\n> # ls .git\n> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> # ls .git\n> # git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> # git cat-file -p HEAD\n>\n> And send the transcript.\nHere is:\n\n# ls .git\nbranches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks  index \ninfo  logs  objects  ORIG_HEAD  packed-refs  refs\n# git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n[dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses\n  1 files changed, 33 insertions(+), 1 deletions(-)\n# ls .git\nbranches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD \nHEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs\n# git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\ntree f29742a1a73c27a88c7ac701a7a06ac1c2f7973a\nparent e7a3af5d8cd782b84e6ca4e4dcc8613be1a809f0\nauthor Neil Jones <NeilJay@gmail.com> 1274141908 -0700\ncommitter David S. Miller <davem@davemloft.net> 1274141908 -0700\n\ndrivers/net/usb/asix.c: Fix unaligned accesses\n\nUsing this driver can cause unaligned accesses in the IP layer\nThis has been fixed by aligning the skb data correctly using the\nspare room left over by the 4 byte header inserted between packets\nby the device.\n\nSigned-off-by: Neil Jones <NeilJay@gmail.com>\nSigned-off-by: David S. Miller <davem@davemloft.net>\n# git cat-file -p HEAD\ntree 282b6492d9d5bcf1c3718420c6f31ca2033ca5cb\nparent c8054f854773e65d8592f2ef35939ec2ae8b01df\nauthor Nicolas Dichtel <nicolas.dichtel@6wind.com> 1317886553 +0200\ncommitter Nicolas Dichtel <nicolas.dichtel@6wind.com> 1317886553 +0200\n\ndrivers/net/usb/asix.c: Fix unaligned accesses\n\nUsing this driver can cause unaligned accesses in the IP layer\nThis has been fixed by aligning the skb data correctly using the\nspare room left over by the 4 byte header inserted between packets\nby the device.\n\nSigned-off-by: Neil Jones <NeilJay@gmail.com>\nSigned-off-by: David S. Miller <davem@davemloft.net>\n#\n\n\nRegards,\nNicolas\n"},{"id":"177010","messageId":"4E8D5E68.8050403@6wind.com","threadId":"28591","inReplyTo":"4E8D5AD0.2040509@6wind.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Nicolas Dichtel","fromEmail":"nicolas.dichtel@6wind.com","sentAt":"2011-10-06T07:53:12Z","receivedAt":"2011-10-06T07:53:12Z","isPatch":false,"sender":{"key":"nicolas.dichtel@6wind.com","avatar":null},"body":"Le 06/10/2011 09:37, Nicolas Dichtel a écrit :\n> Le 05/10/2011 18:50, Jay Soffian a écrit :\n>> On Wed, Oct 5, 2011 at 10:52 AM, Nicolas Dichtel\n>> <nicolas.dichtel@6wind.com> wrote:\n>>> Hi,\n>>>\n>>> still with version 1.7.6.4, when I do a cherry-pick, that succeeded, I\n>>> cannot do a commit --amend after:\n>>>\n>>> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n>>> [dev 1a04a23] drivers/net/usb/asix.c: Fix unaligned accesses\n>>> 1 files changed, 33 insertions(+), 1 deletions(-)\n>>> # echo $?\n>>> 0\n>>> # git commit --amend\n>>> fatal: You are in the middle of a cherry-pick -- cannot amend.\n>>> #\n>>>\n>>> The same operations (with the same patch), with version 1.7.3.4 is ok.\n>>\n>> Please do the following with 1.7.6.4:\n>>\n>> # ls .git\n>> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n>> # ls .git\n>> # git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n>> # git cat-file -p HEAD\n>>\n>> And send the transcript.\n> Here is:\n>\n> # ls .git\n> branches COMMIT_EDITMSG config description FETCH_HEAD HEAD hooks index info logs\n> objects ORIG_HEAD packed-refs refs\n> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> [dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses\n> 1 files changed, 33 insertions(+), 1 deletions(-)\n> # ls .git\n> branches CHERRY_PICK_HEAD COMMIT_EDITMSG config description FETCH_HEAD HEAD\n> hooks index info logs objects ORIG_HEAD packed-refs refs\n> # git cat-file -p 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> tree f29742a1a73c27a88c7ac701a7a06ac1c2f7973a\n> parent e7a3af5d8cd782b84e6ca4e4dcc8613be1a809f0\n> author Neil Jones <NeilJay@gmail.com> 1274141908 -0700\n> committer David S. Miller <davem@davemloft.net> 1274141908 -0700\n>\n> drivers/net/usb/asix.c: Fix unaligned accesses\n>\n> Using this driver can cause unaligned accesses in the IP layer\n> This has been fixed by aligning the skb data correctly using the\n> spare room left over by the 4 byte header inserted between packets\n> by the device.\n>\n> Signed-off-by: Neil Jones <NeilJay@gmail.com>\n> Signed-off-by: David S. Miller <davem@davemloft.net>\n> # git cat-file -p HEAD\n> tree 282b6492d9d5bcf1c3718420c6f31ca2033ca5cb\n> parent c8054f854773e65d8592f2ef35939ec2ae8b01df\n> author Nicolas Dichtel <nicolas.dichtel@6wind.com> 1317886553 +0200\n> committer Nicolas Dichtel <nicolas.dichtel@6wind.com> 1317886553 +0200\n>\n> drivers/net/usb/asix.c: Fix unaligned accesses\n>\n> Using this driver can cause unaligned accesses in the IP layer\n> This has been fixed by aligning the skb data correctly using the\n> spare room left over by the 4 byte header inserted between packets\n> by the device.\n>\n> Signed-off-by: Neil Jones <NeilJay@gmail.com>\n> Signed-off-by: David S. Miller <davem@davemloft.net>\n> #\n>\nThere is another symptom, describe in this thread:\nhttp://comments.gmane.org/gmane.comp.version-control.git/182852\n\nMaybe the two problems are related.\n\n\nRegards,\nNicolas\n"},{"id":"177019","messageId":"CAG+J_DzY6oW3CgCPDhD81Eue1Ygh+3pR7Q_NZEhauH_qkyUwqQ@mail.gmail.com","threadId":"28591","inReplyTo":"4E8D5AD0.2040509@6wind.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-06T13:09:06Z","receivedAt":"2011-10-06T13:09:06Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Oct 6, 2011 at 3:37 AM, Nicolas Dichtel\n<nicolas.dichtel@6wind.com> wrote:\n> # ls .git\n> branches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks\n>  index info  logs  objects  ORIG_HEAD  packed-refs  refs\n\nNo CHERRY_PICK_HEAD, so far so good.\n\n> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> [dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses\n>  1 files changed, 33 insertions(+), 1 deletions(-)\n\ncherry-pick completes successfully.\n\n> # ls .git\n> branches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD\n> HEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs\n\nThis is bad. CHERRY_PICK_HEAD should only exist if the cherry-pick failed.\n\nI really don't know what could cause this. Possibly a hook in your repo?\n\nUsing \"GIT_TRACE=1 git cherry-pick\n3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\" will tell you whether git is\nrunning any hooks.\n\nI can't think of anything config-wise that would cause this behavior.\n\nI'll peer at the code some more...\n\nj.\n"},{"id":"177021","messageId":"4E8DABB0.4090206@6wind.com","threadId":"28591","inReplyTo":"CAG+J_DzY6oW3CgCPDhD81Eue1Ygh+3pR7Q_NZEhauH_qkyUwqQ@mail.gmail.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Nicolas Dichtel","fromEmail":"nicolas.dichtel@6wind.com","sentAt":"2011-10-06T13:22:56Z","receivedAt":"2011-10-06T13:22:56Z","isPatch":false,"sender":{"key":"nicolas.dichtel@6wind.com","avatar":null},"body":"Le 06/10/2011 15:09, Jay Soffian a écrit :\n> On Thu, Oct 6, 2011 at 3:37 AM, Nicolas Dichtel\n> <nicolas.dichtel@6wind.com>  wrote:\n>> # ls .git\n>> branches  COMMIT_EDITMSG  config  description  FETCH_HEAD  HEAD  hooks\n>>   index info  logs  objects  ORIG_HEAD  packed-refs  refs\n>\n> No CHERRY_PICK_HEAD, so far so good.\n>\n>> # git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n>> [dev 4cca2c2] drivers/net/usb/asix.c: Fix unaligned accesses\n>>   1 files changed, 33 insertions(+), 1 deletions(-)\n>\n> cherry-pick completes successfully.\n>\n>> # ls .git\n>> branches  CHERRY_PICK_HEAD  COMMIT_EDITMSG  config  description  FETCH_HEAD\n>> HEAD  hooks  index  info  logs  objects  ORIG_HEAD  packed-refs  refs\n>\n> This is bad. CHERRY_PICK_HEAD should only exist if the cherry-pick failed.\n>\n> I really don't know what could cause this. Possibly a hook in your repo?\nNo hooks:\n# ls .git/hooks/\napplypatch-msg.sample  post-commit.sample   post-update.sample \npre-commit.sample          pre-rebase.sample\ncommit-msg.sample      post-receive.sample  pre-applypatch.sample \nprepare-commit-msg.sample  update.sample\n\n>\n> Using \"GIT_TRACE=1 git cherry-pick\n> 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\" will tell you whether git is\n> running any hooks.\nHere is the output:\n# GIT_TRACE=1 git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\ntrace: built-in: git 'cherry-pick' '3f78d1f210ff89af77f042ab7f4a8fee39feb1c9'\ntrace: run_command: 'commit' '-n' '-F' '.git/MERGE_MSG'\ntrace: exec: 'git' 'commit' '-n' '-F' '.git/MERGE_MSG'\nsetup: git_dir: .git\nsetup: worktree: /home/dichtel/DEV/linux-2.6\nsetup: cwd: /home/dichtel/DEV/linux-2.6\nsetup: prefix: (null)\ntrace: built-in: git 'commit' '-n' '-F' '.git/MERGE_MSG'\n[master 8372873] drivers/net/usb/asix.c: Fix unaligned accesses\n  1 files changed, 33 insertions(+), 1 deletions(-)\n#\n\n>\n> I can't think of anything config-wise that would cause this behavior.\nWith a very basic config, the pb he still here:\ncat ~/.gitconfig\n[user]\n         name = Nicolas Dichtel\n         email = nicolas.dichtel@6wind.com\n\nI will try to do some other tests.\n\n\nRegards,\nNicolas\n"},{"id":"177027","messageId":"CAG+J_DyJri1iTMWbeab9Dm15=p2wDUw_vt7TXEYSyGXAK6zWkg@mail.gmail.com","threadId":"28591","inReplyTo":"4E8DABB0.4090206@6wind.com","subject":"Re: git-cherry-pick and git-commit --amend in version 1.7.6.4","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-10-06T13:44:45Z","receivedAt":"2011-10-06T13:44:45Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Oct 6, 2011 at 9:22 AM, Nicolas Dichtel\n<nicolas.dichtel@6wind.com> wrote:\n> Here is the output:\n> # GIT_TRACE=1 git cherry-pick 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9\n> trace: built-in: git 'cherry-pick'\n> '3f78d1f210ff89af77f042ab7f4a8fee39feb1c9'\n> trace: run_command: 'commit' '-n' '-F' '.git/MERGE_MSG'\n> trace: exec: 'git' 'commit' '-n' '-F' '.git/MERGE_MSG'\n> setup: git_dir: .git\n> setup: worktree: /home/dichtel/DEV/linux-2.6\n> setup: cwd: /home/dichtel/DEV/linux-2.6\n> setup: prefix: (null)\n> trace: built-in: git 'commit' '-n' '-F' '.git/MERGE_MSG'\n\nI have a theory that determine_whence() inside commit.c isn't finding\n.git/CHERRY_PICK_HEAD:\n\n\telse if (file_exists(git_path(\"CHERRY_PICK_HEAD\")))\n\t\twhence = FROM_CHERRY_PICK;\n\nThat would cause the mis-attributed cherry-picked commit. commit.c is\nalso responsible for removing CHERRY_PICK_HEAD, which is not happening\ncorrectly:\n\n\tunlink(git_path(\"CHERRY_PICK_HEAD\"));\n\nMaybe git_path(\"CHERRY_PICK_HEAD\") is returning something unexpected.\nBut the trace output looks fine.\n\nAside, I'm a little confused by the \"setup:\" output appearing above.\nIn 1.7.5 and later, it requires setting GIT_TRACE_SETUP=1 to appear,\nbut you reported you're having this problem with 1.7.6.4.\n\nj.\n"}]}