{"thread":{"id":"2864","subject":"[PATCH] Fix git-am --skip","startedAt":"2005-12-17T06:01:06Z","lastAt":"2005-12-17T06:41:04Z","messageCount":2,"participants":["Jan Harkes","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"13759","messageId":"20051217060106.GS30531@delft.aura.cs.cmu.edu","threadId":"2864","inReplyTo":null,"subject":"[PATCH] Fix git-am --skip","fromName":"Jan Harkes","fromEmail":"jaharkes@cs.cmu.edu","sentAt":"2005-12-17T06:01:06Z","receivedAt":"2005-12-17T06:01:06Z","isPatch":true,"sender":{"key":"jaharkes@cs.cmu.edu","avatar":"https://gravatar.com/avatar/cf95aecd150ca8ef33d6edc337ac4bb9e13aa4246fc3679257d578c7fddc1633?d=mp&s=160"},"body":"git-am --skip does not unpack the next patch and ends up reapplying the\nold patch, believing that it is the new patch in the sequence.\n\nIf the old patch applied successfully it will commit it with the\nsupposedly skipped log message and ends up dropping the following patch.\nIf the patch did not apply the user is left with the conflict he tried\nto skip and has to unpack the next patch in the sequence by hand to get\ngit-am back on track.\n\nBy clearing the resume variable whenever skips bumps the sequence\ncounter we correctly unpack the next patch. I also added another\nresume= in the case a patch file is missing from the sequence to\navoid the same problem when a file in the sequence was removed.\n\nSigned-off-by: Jan Harkes <jaharkes@cs.cmu.edu>\n\n---\n\n git-am.sh |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\n5cfce3a48e6a6cf08caa5fae990eeeaf08154921\ndiff --git a/git-am.sh b/git-am.sh\nindex 1a114bc..731ab1f 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -211,6 +211,7 @@ this=`cat \"$dotest/next\"`\n if test \"$skip\" = t\n then\n \tthis=`expr \"$this\" + 1`\n+\tresume=\n fi\n \n if test \"$this\" -gt \"$last\"\n@@ -225,6 +226,7 @@ do\n \tmsgnum=`printf \"%0${prec}d\" $this`\n \tnext=`expr \"$this\" + 1`\n \ttest -f \"$dotest/$msgnum\" || {\n+\t\tresume=\n \t\tgo_next\n \t\tcontinue\n \t}\n-- \n0.99.9.GIT\n"},{"id":"13760","messageId":"7v7ja4b4zj.fsf@assigned-by-dhcp.cox.net","threadId":"2864","inReplyTo":"20051217060106.GS30531@delft.aura.cs.cmu.edu","subject":"Re: [PATCH] Fix git-am --skip","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-17T06:41:04Z","receivedAt":"2005-12-17T06:41:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}