{"thread":{"id":"38708","subject":"Possible bug with git-rebase and post-rewrite hook","startedAt":"2015-03-05T13:55:12Z","lastAt":"2015-03-05T14:05:44Z","messageCount":2,"participants":["Francis Moreau"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"257073","messageId":"54F86040.8060205@gmail.com","threadId":"38708","inReplyTo":null,"subject":"Possible bug with git-rebase and post-rewrite hook","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2015-03-05T13:55:12Z","receivedAt":"2015-03-05T13:55:12Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hi,\n\nI have a suspect case which happens when rebasing a branch.\n\nI'm using the post-rewrite hook and during certain circumstance, my hook\nis called by git-rebase with wrong parameters: <old-sha1> argument is\nnot related to <new-sha1> one.\n\nThis actually happens when git-rebase stops and reports:\n\n  The previous cherry-pick is now empty, possibly due to conflict\n  resolution.\n  If you wish to commit it anyway, use:\n\n      git commit --allow-empty\n\n  Otherwise, please use 'git reset'\n  rebase in progress; onto 2889531\n  You are currently rebasing branch 'foo' on '2889531'.\n\n\nIf I decide to skip it by doing 'git rebase --continue' then I get the\nissue when my hook is run.\n\nBTW, I find that the message is not really clear since it tells me to\nrun 'git-reset' in the case I want to ignore this empty commit. I'm not\nsure that 'git-reset' is really helping in that case (my index is clean)\nbut 'git rebase --continue' would have been more appropriate IMHO.\n\nIf I do 'git commit --allow-empty' then there's no issue when the hook\nis run.\n\nThanks.\n"},{"id":"257074","messageId":"54F862B8.2040901@gmail.com","threadId":"38708","inReplyTo":"54F86040.8060205@gmail.com","subject":"Re: Possible bug with git-rebase and post-rewrite hook","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2015-03-05T14:05:44Z","receivedAt":"2015-03-05T14:05:44Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"oops, I forgot to say that this happen with git 2.3.1.\n\nOn 03/05/2015 02:55 PM, Francis Moreau wrote:\n> Hi,\n> \n> I have a suspect case which happens when rebasing a branch.\n> \n> I'm using the post-rewrite hook and during certain circumstance, my hook\n> is called by git-rebase with wrong parameters: <old-sha1> argument is\n> not related to <new-sha1> one.\n> \n> This actually happens when git-rebase stops and reports:\n> \n>   The previous cherry-pick is now empty, possibly due to conflict\n>   resolution.\n>   If you wish to commit it anyway, use:\n> \n>       git commit --allow-empty\n> \n>   Otherwise, please use 'git reset'\n>   rebase in progress; onto 2889531\n>   You are currently rebasing branch 'foo' on '2889531'.\n> \n> \n> If I decide to skip it by doing 'git rebase --continue' then I get the\n> issue when my hook is run.\n> \n> BTW, I find that the message is not really clear since it tells me to\n> run 'git-reset' in the case I want to ignore this empty commit. I'm not\n> sure that 'git-reset' is really helping in that case (my index is clean)\n> but 'git rebase --continue' would have been more appropriate IMHO.\n> \n> If I do 'git commit --allow-empty' then there's no issue when the hook\n> is run.\n> \n> Thanks.\n> \n"}]}