I've gone and broken the build

Aha, I think I see what is going on. Commit e8e3693 should not have been pushed. I must have forgotten to --amend that commit with the second one, 93b4f853. I must learn to do a 'git log' to check for that mistake.

My apologies. I do not know how to fix this problem.

Hi Paul,

If you setup the git hook as indicated here: https://llvm.org/docs/GettingStarted.html#git-pre-push-hook ; it’ll ask for confirmation before pushing multiple commits.

Also the section right before gives the manual recipe before pushing:

# Check that the list of commits about to be pushed is correct.
% git log origin/master...HEAD --oneline

Yes, I know I should do the 'git log'. Now I just have to force myself into the right habits. I have an alias to make it easier.

I'm on Windows. Is there a way to set up that hook?

Ah sorry I’m not familiar enough with Windows, maybe someone else can chime in (and then we could update the doc as well).

I'm standing by waiting to learn what to do about the broken build . . .

Paul:

If you pushed a commit you didn’t intend to push, you just need to push a reversion. You can do this with:

git revert
git push

  • Eric

I’m on Windows. Is there a way to set up that hook?

Ah sorry I’m not familiar enough with Windows, maybe someone else can chime in (and then we could update the doc as well).

I’m standing by waiting to learn what to do about the broken build . . .

The build was not (at the time when I looked yesterday) broken, so I was too confused to say more then.

I think I understand the situation now: You did not intend to push either e8e3693ceaa1afe267f21d2ba8d9565ea8fe7c12 or 93b4f8538267e620de4a36e7cf0abc0d4f8d7c10, but the squashed version of the two. If that’s the case, there’s nothing to do now: the first left the tree in a bad state and one after fixed it.

Yes, you are correct. The second commit should have been an amend. I shall now endeavor to check each commit before I push it, to ensure there is exactly one.

My concern was how to restart the build with the second commit, but apparently that is automatic or someone did it for me. Thanks to all for your patience!

Yes, you are correct. The second commit should have been an amend. I shall now endeavor to check each commit before I push it, to ensure there is exactly one.

My concern was how to restart the build with the second commit, but apparently that is automatic or someone did it for me. Thanks to all for your patience!

Yeah, it’s automatic - the bots keep rolling new revisions without need for manual intervention. If you commit a breakage the best you can do is commit the fix (if the forward fix is uncertain/complex, may be better to commit a revert as a fix) as soon as possible (while being as careful as possible not to introduce other issues) to reduce the window of breakage. (if you’ve already committed the fix, as in your case, then there’s nothing to do - watch the bots, see that they go green again after picking up that change, etc)

  • Dave