{"thread":{"id":"17396","subject":"rebase failure if commit message looks like a patch","startedAt":"2009-01-27T17:50:43Z","lastAt":"2009-01-27T18:15:55Z","messageCount":2,"participants":["Anton","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"102145","messageId":"loom.20090127T173025-125@post.gmane.org","threadId":"17396","inReplyTo":null,"subject":"rebase failure if commit message looks like a patch","fromName":"Anton","fromEmail":"anton.sharonov@gmail.com","sentAt":"2009-01-27T17:50:43Z","receivedAt":"2009-01-27T17:50:43Z","isPatch":false,"sender":{"key":"anton.sharonov@gmail.com","avatar":null},"body":"I have found a strange behaviour of \"git rebase\", present in following versions:\n\ngit 1.6.1, linux,\ngit 1.6.0.4, cygwin\n\nif the commit message of one of revisions on local branch\ncontaining something, what looks like patch:\n\n------------------ bad-commit-message { ---------------\nchangeset a1 - feature added\n\n--- a0  2009-01-25 10:09:05.953125000 +0100\n+++ ./r/a       2009-01-25 10:15:20.093750000 +0100\n@@ -1,5 +1,5 @@\n-1\n+1 - upstream\n 2\n 3\n 4\n-5\n+5 - feature\n------------------ bad-commit-message } ---------------\n\nFollowing shell script reproduces the bug for me:\n\n------------------ show-bug.sh { ---------------\n#!/bin/bash\nrm -rf r # clean-up\nmkdir r # repo dir\ncd r\ngit init\ncd ..\ncp a0 r/a\ncd r\ngit add a\ngit ci -m \"initial addition of a0\"\ngit br feature\ngit co feature\ncd ..\ncp a1 r/a\ncd r\ngit add a\n## no bug\n#git ci -m \"changeset a1 - feature added\"\n# bug\ngit ci -F ../bad-commit-message\ngit co master\ncd ..\ncp a2 r/a\ncd r\ngit add a\ngit ci -m \"changeset a2 - upstream revision\"\ngit co feature\ngit rebase master\n------------------ show-bug.sh } ---------------\n\nproduces the error on final rebase attempt:\n\nFirst, rewinding head to replay your work on top of it...\nApplying: changeset a1 - feature added\nerror: r/a: does not exist in index\nfatal: sha1 information is lacking or useless (r/a).\nRepository lacks necessary blobs to fall back on 3-way merge.\nCannot fall back to three-way merge.\nPatch failed at 0001.\n\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo restore the original branch and stop rebasing run \"git rebase --abort\".\n\nIn case one uses\n# no bug\ngit ci -m \"changeset a1 - feature added\"\ninstead of\n# bug\ngit ci -F ../bad-commit-message\n\nThe final rebase succeded !\n\nContent of other files:\n\n---------------- a0 { -------------------\n1\n2\n3\n4\n5\n---------------- a0 } -------------------\n\n---------------- a1 { -------------------\n1\n2\n3\n4\n5 - feature\n---------------- a1 } -------------------\n\n---------------- a2 { -------------------\n1 - upstream\n2\n3\n4\n5\n---------------- a2 } -------------------\n\n-- \nAnton\n"},{"id":"102150","messageId":"alpine.DEB.1.00.0901271914130.3586@pacific.mpi-cbg.de","threadId":"17396","inReplyTo":"loom.20090127T173025-125@post.gmane.org","subject":"Re: rebase failure if commit message looks like a patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-27T18:15:55Z","receivedAt":"2009-01-27T18:15:55Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Jan 2009, Anton wrote:\n\n> I have found a strange behaviour of \"git rebase\", present in following \n> versions:\n\nThat is a known issue.  Please work around it with redoing the rebase with \n-m.\n\nI could imagine that we should scan the commit messages before actually \nrunning rebase, and either activate -m, or escape the \"diff\" with a \nbackslash (as is frequently done with \"From\" in mails).\n\nCiao,\nDscho\n"}]}