{"thread":{"id":"16453","subject":"Confusion with git rebase -i","startedAt":"2008-11-24T23:02:05Z","lastAt":"2008-11-24T23:02:05Z","messageCount":1,"participants":["Jean-Luc Herren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96442","messageId":"492B326D.1050901@gmx.ch","threadId":"16453","inReplyTo":null,"subject":"Confusion with git rebase -i","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2008-11-24T23:02:05Z","receivedAt":"2008-11-24T23:02:05Z","isPatch":false,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"Hi list!\n\nI often edit recent commits I haven't pushed out yet using \"git\nrebase -i HEAD~5\".  And it's very helpful that whenever \"git\nrebase\" stops, it tells me what to do next.  So normally it stops\nand tells me that I can now ammend the commit and then run \"git\nrebase --continue\", or if a conflict happens, it tells to fix\nthat, \"git add\", \"git rebase --continue\".  But I stumbled over a\nsituation where doing what it says doesn't do what I want.\n\nLet's say my HEAD commit is fine, but I want to edit HEAD~1 and\nHEAD~2, so I run \"git rebase -i HEAD~3\" and change 'pick' to\n'edit' on the two lines I'm interested in.  It stops after the\nfirst commit, letting me amend it and then I do \"git rebase\n--continue\".  Unfortunately my fix to the first commit conflicts\nwith the second commit, and I get this:\n\n    Auto-merged filename\n    CONFLICT (content): Merge conflict in filename\n    Automatic cherry-pick failed.  After resolving the conflicts,\n    mark the corrected paths with 'git add <paths>', and\n    run 'git rebase --continue'\n    Could not apply abcdefa... Commit message\n\nReading this message, I understand this isn't yet my chance to\namend the second commit, this is merely a rebase conflict I need\nto fix before I can proceed.  So I do what it says and fix only\nthe conflict and do \"git add\" and \"git rebase --continue\", but\nthen to my surprise I now won't get a chance to edit the second\ncommit.\n\nWhat I have to do instead in that situation, is to resolve the\nconflict *and also* add my fix to the second commit, and then\nremember to do \"git add\" and \"git commit\" *without the --amend*.\nAnd then finally \"git rebase --continue\".  But it doesn't tell me\nany of that...\n\nI don't know if the message above is wrong, or if there's a bug\nthat just prevents it to stop again after a conflict of a commit\nthat has been marked \"edit\".  Though stopping twice (once to\nresolve conflict, once to amend the commit) at almost the same\nplace can be just as confusing, so fixing the conflict *and*\nintroduce my change to the commit at once is fine, but then it\nshould say so, or I'll be confused.\n\nOr am I missing something?  Using git 1.6.0.4.\n\nThanks,\njlh\n"}]}