{"thread":{"id":"15026","subject":"[BUG] git rebase is confuse if conflict resolution doesn't produce diff","startedAt":"2008-08-15T17:00:43Z","lastAt":"2008-08-18T09:10:56Z","messageCount":4,"participants":["Guillaume Desmottes","Stephan Beyer","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87326","messageId":"1218819643.6345.57.camel@cass-lpt","threadId":"15026","inReplyTo":null,"subject":"[BUG] git rebase is confuse if conflict resolution doesn't produce diff","fromName":"Guillaume Desmottes","fromEmail":"guillaume.desmottes@collabora.co.uk","sentAt":"2008-08-15T17:00:43Z","receivedAt":"2008-08-15T17:00:43Z","isPatch":false,"sender":{"key":"guillaume.desmottes@collabora.co.uk","avatar":null},"body":"To reproduce:\n- Rebase a branch \"foo\" on a branch \"bar\" in a way that there is a\nconflict that you have to manually resolve.\n- Run git diff and see the conflict\n- Edit the conflicted file and remove all the conflicting bits (that\ncould be a valid resolution of the conflict)\n- Now git diff produces an empty diff\n- git add $CONFLICTED_FILE  as you have resolve the conflict\n- git rebase --continue\n\nYou get the following error:\nNo changes - did you forget to use 'git add'?\n\ngit status is empty as the conflict was resolved.\n\nA simple workaround is to add a dummy blank line in the conflicted file\nso the diff is not empty.\n\n\n\tG.\n"},{"id":"87336","messageId":"20080815182439.GB23326@leksak.fem-net","threadId":"15026","inReplyTo":"1218819643.6345.57.camel@cass-lpt","subject":"Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-08-15T18:24:39Z","receivedAt":"2008-08-15T18:24:39Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nGuillaume Desmottes wrote:\n> To reproduce:\n> - Rebase a branch \"foo\" on a branch \"bar\" in a way that there is a\n> conflict that you have to manually resolve.\n> - Run git diff and see the conflict\n> - Edit the conflicted file and remove all the conflicting bits (that\n> could be a valid resolution of the conflict)\n> - Now git diff produces an empty diff\n> - git add $CONFLICTED_FILE  as you have resolve the conflict\n> - git rebase --continue\n> \n> You get the following error:\n> No changes - did you forget to use 'git add'?\n> \n> git status is empty as the conflict was resolved.\n> \n> A simple workaround is to add a dummy blank line in the conflicted file\n> so the diff is not empty.\n\nI think this is no bug, since you would generate an empty commit, i.e\na commit with no changes at all. Usually you do not want such commits.\nSo git rebase --skip is perhaps what you want.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"87339","messageId":"7vzlne9l49.fsf@gitster.siamese.dyndns.org","threadId":"15026","inReplyTo":"1218819643.6345.57.camel@cass-lpt","subject":"Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-15T18:41:26Z","receivedAt":"2008-08-15T18:41:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> writes:\n\n> To reproduce:\n> - Rebase a branch \"foo\" on a branch \"bar\" in a way that there is a\n> conflict that you have to manually resolve.\n> - Run git diff and see the conflict\n> - Edit the conflicted file and remove all the conflicting bits (that\n> could be a valid resolution of the conflict)\n> - Now git diff produces an empty diff\n> - git add $CONFLICTED_FILE  as you have resolve the conflict\n> - git rebase --continue\n\nI think you would need a bit more than that to trigger this \"behaviour\".\nYour resolution needs to be such that it is identical to the HEAD where\nthe rebased change is applied to, iow, among the series of commits, the\nfinal effect chosen by you from this particular one is not to do\nanything.  So, not just \"Now git diff produces an empty diff\" in the above\nsequence, which merely means that the three-way --cc diff between the\nconflicted parties are resolved by taking from one side, after that \"git\nadd\", \"git diff HEAD\" will have to be empty, for you to see the message.\n\nIn essence, the final effect chosen by you is to skip this commit.  You\nmight want to say \"git rebase --skip\" here if that is the case.\n"},{"id":"87522","messageId":"1219050656.20418.3.camel@cass-lpt","threadId":"15026","inReplyTo":"20080815182439.GB23326@leksak.fem-net","subject":"Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff","fromName":"Guillaume Desmottes","fromEmail":"guillaume.desmottes@collabora.co.uk","sentAt":"2008-08-18T09:10:56Z","receivedAt":"2008-08-18T09:10:56Z","isPatch":false,"sender":{"key":"guillaume.desmottes@collabora.co.uk","avatar":null},"body":"Le vendredi 15 août 2008 à 20:24 +0200, Stephan Beyer a écrit :\n> Hi,\n> \n> Guillaume Desmottes wrote:\n> > To reproduce:\n> > - Rebase a branch \"foo\" on a branch \"bar\" in a way that there is a\n> > conflict that you have to manually resolve.\n> > - Run git diff and see the conflict\n> > - Edit the conflicted file and remove all the conflicting bits (that\n> > could be a valid resolution of the conflict)\n> > - Now git diff produces an empty diff\n> > - git add $CONFLICTED_FILE  as you have resolve the conflict\n> > - git rebase --continue\n> > \n> > You get the following error:\n> > No changes - did you forget to use 'git add'?\n> > \n> > git status is empty as the conflict was resolved.\n> > \n> > A simple workaround is to add a dummy blank line in the conflicted file\n> > so the diff is not empty.\n> \n> I think this is no bug, since you would generate an empty commit, i.e\n> a commit with no changes at all. Usually you do not want such commits.\n> So git rebase --skip is perhaps what you want.\n\nYeah, I know, that's what I did when I finally understood the problem.\nBut that took me more than 20 minutes before understanding what I did\nwrong (I just manually resolved the conflict and wasn't aware that what\nI actually wanted was to remove the commit).\n\nMaybe in that case git rebase should suggest something like that \"Seems\nyou want to skip this commit. Do you want to --skip it ?\".\n\n\n\tG.\n"}]}