{"thread":{"id":"28879","subject":"hook for rebase --continue","startedAt":"2011-11-07T19:42:32Z","lastAt":"2011-11-15T23:28:12Z","messageCount":5,"participants":["Matt Graham","Martin Fick","Neal Kreitzinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"179068","messageId":"CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com","threadId":"28879","inReplyTo":null,"subject":"hook for rebase --continue","fromName":"Matt Graham","fromEmail":"mdg149@gmail.com","sentAt":"2011-11-07T19:42:32Z","receivedAt":"2011-11-07T19:42:32Z","isPatch":false,"sender":{"key":"mdg149@gmail.com","avatar":"https://gravatar.com/avatar/a1f130a60a6550f75e8d7d3849e58e46494f36bfaf764a38cfd695ac85de8576?d=mp&s=160"},"body":"Hi,\nI did some testing and it appears that during a rebase, if I resolve a\nconflict and call git rebase --continue, the pre-commit hook doesn't\nrun.  This means that if I don't resolve the conflict correctly, our\ncheck for invalid syntax doesn't get run and creates the risk that\nsomeone could push code with invalid syntax, not realizing that the\ncheck didn't run.\n\nDoes anyone else share my expectation that the pre-commit hook should\nrun during a rebase? Or at least for the first commit following a\nrebase conflict?\n\nIf not, is there another hook that is triggered by a rebase that I\nshould be using instead?\n\nThanks,\nMatt\n"},{"id":"179069","messageId":"201111071246.35100.mfick@codeaurora.org","threadId":"28879","inReplyTo":"CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com","subject":"Re: hook for rebase --continue","fromName":"Martin Fick","fromEmail":"mfick@codeaurora.org","sentAt":"2011-11-07T19:46:34Z","receivedAt":"2011-11-07T19:46:34Z","isPatch":false,"sender":{"key":"mfick@codeaurora.org","avatar":null},"body":"On Monday, November 07, 2011 12:42:32 pm Matt Graham wrote:\n> Does anyone else share my expectation that the pre-commit\n> hook should run during a rebase? Or at least for the\n> first commit following a rebase conflict?\n\nI have had the same concern.  We use a change-id hook for \nGerrit development, and it adds a footer line to commit \nmessages.  If during a rebase, it is accidentally removed, \nthe hook does not get run and does not re-add it,\n\n-Martin\n\n-- \nEmployee of Qualcomm Innovation Center, Inc. which is a \nmember of Code Aurora Forum\n"},{"id":"179227","messageId":"4EBB1F17.4060907@gmail.com","threadId":"28879","inReplyTo":"CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com","subject":"Re: hook for rebase --continue","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-11-10T00:47:19Z","receivedAt":"2011-11-10T00:47:19Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 11/7/2011 1:42 PM, Matt Graham wrote:\n> I did some testing and it appears that during a rebase, if I resolve\n> a conflict and call git rebase --continue, the pre-commit hook\n> doesn't run.  This means that if I don't resolve the conflict\n> correctly, our check for invalid syntax doesn't get run and creates\n> the risk that someone could push code with invalid syntax, not\n> realizing that the check didn't run.\n>\n> Does anyone else share my expectation that the pre-commit hook\n> should run during a rebase? Or at least for the first commit\n> following a rebase conflict?\n>\n> If not, is there another hook that is triggered by a rebase that I\n> should be using instead?\n>\nYou could try creating an alias (e.g. \"git rebase-continue\") in your \ngitconfig that runs the desired validation logic and then executes git \nrebase.  Then you would run \"git rebase-continue\" instead of \"git rebase \n--continue\".\n\nv/r,\nneal\n"},{"id":"179228","messageId":"4EBB1FDE.7020006@gmail.com","threadId":"28879","inReplyTo":"4EBB1F17.4060907@gmail.com","subject":"Re: hook for rebase --continue","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-11-10T00:50:38Z","receivedAt":"2011-11-10T00:50:38Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 11/9/2011 6:47 PM, Neal Kreitzinger wrote:\n> On 11/7/2011 1:42 PM, Matt Graham wrote:\n>> I did some testing and it appears that during a rebase, if I resolve\n>> a conflict and call git rebase --continue, the pre-commit hook\n>> doesn't run. This means that if I don't resolve the conflict\n>> correctly, our check for invalid syntax doesn't get run and creates\n>> the risk that someone could push code with invalid syntax, not\n>> realizing that the check didn't run.\n>>\n>> Does anyone else share my expectation that the pre-commit hook\n>> should run during a rebase? Or at least for the first commit\n>> following a rebase conflict?\n>>\n>> If not, is there another hook that is triggered by a rebase that I\n>> should be using instead?\n>>\n> You could try creating an alias (e.g. \"git rebase-continue\") in your\n> gitconfig that runs the desired validation logic and then executes git\n> rebase --continue. Then you would run \"git rebase-continue\" instead of \"git rebase\n> --continue\".\n>\ncorrection: added the --continue option in the alias example above.\n\n--neal\n"},{"id":"179542","messageId":"4EC2F58C.9020202@gmail.com","threadId":"28879","inReplyTo":"CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com","subject":"Re: hook for rebase --continue","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-11-15T23:28:12Z","receivedAt":"2011-11-15T23:28:12Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 11/7/2011 1:42 PM, Matt Graham wrote:\n> Hi, I did some testing and it appears that during a rebase, if I\n> resolve a conflict and call git rebase --continue, the pre-commit\n> hook doesn't run.  This means that if I don't resolve the conflict\n> correctly, our check for invalid syntax doesn't get run and creates\n> the risk that someone could push code with invalid syntax, not\n> realizing that the check didn't run.\n>\n> Does anyone else share my expectation that the pre-commit hook\n> should run during a rebase? Or at least for the first commit\n> following a rebase conflict?\n>\n> If not, is there another hook that is triggered by a rebase that I\n> should be using instead?\n>\nI just noticed there is a post-rewrite hook in the manpage\nhttp://schacon.github.com/git/githooks.html.  Maybe this does what you want.\n\nv/r,\nneal\n"}]}