{"thread":{"id":"25046","subject":"interactive rebase \"reword\" runs pre-commit hook but ignores non-zero exit status","startedAt":"2010-09-09T00:26:58Z","lastAt":"2010-09-09T00:26:58Z","messageCount":1,"participants":["Neal Kreitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150336","messageId":"i699mo$8jd$1@dough.gmane.org","threadId":"25046","inReplyTo":null,"subject":"interactive rebase \"reword\" runs pre-commit hook but ignores non-zero exit status","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2010-09-09T00:26:58Z","receivedAt":"2010-09-09T00:26:58Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"I've isolated what seems to be a loophole in interactive rebase by rebasing \na branch for the sole purpose of rewording some commits:\n\n(I just finished performing a rebase for the sole purpose of squashing \nseveral commits into 2 commits)\n(Now I want to reword those 2 commits)\n\n$ git --version = 1.7.1\n$ git rebase -i --onto BranchA~2 BranchA~2 BranchA\n(change \"pick\" to \"reword\" in rebase-stack editor)\nreword Abbrsha1 some-commit-message\nreword Bbbrsha1 some-other-commit-message\n# Rebase Cbbrsha1..Dbbrsha1 onto Cbbrsha1\n(save changes in editor)\n\".git/rebase-merge/git-rebase-todo\" 15L, 580C written\n(shows output from pre-commit hook and the corresponding non-zero exit)\nStart of pre-commit hook...\nchecking for something I don't like...\nERROR: I found something I don't like!\nCommit Aborted!\nStart of pre-commit hook...\nchecking for something I don't like...\nERROR: I found something I don't like!\nCommit Aborted!\nSuccessfully rebased and updated refs/heads/BranchA.\n$ _\n\nIn this case, the thing that caused the pre-commit to error-out was that the \nformat of a report that it runs was changed.  So in this case, I will \nrebase -i and \"edit\" the commits and git-add the new report format so the \npre-commit doesn't complain.  However, I originally tried to do the reword \nand squash in a single rebase and it gave the same errors, but performed the \nsquashes.  Is this the intended behavior?  On the one hand, you shouldn't be \nchanging content in a \"reword\", but on the other hand if you're going to run \nthe pre-commit hook then shouldn't you abort the rebase if the pre-commit \nhook exits with non-zero status?\n\nI admit that a workflow in which content changes on a reword may not be a \nvalid scenario that you should care about in your rebase exception handling, \nbut shouldn't you care that the pre-commit hook exited with non-zero status \nregardless of the reason why it exited with non-zero status?  Just a \nquestion.\n\nv/r,\nNeal\n"}]}