Herald Branches/Tags/Bookmarks hook triggers on Branch Append, not just Create?

Is it the expected behaviour that pushing to an existing branch triggers a Herald rule that applies to Commit Hook: Branches/Tags/Bookmarks? In the push log we see two rows for the push, one of type commit and one of type branch, and the latter has Flags set to Append

We were hoping to use this rule to prevent inadvertent creation of new branches, not prevent pushing to any branch. Should we be using an alternative approach?

phabricator 86ad69863930 Oct 19 2020 b2e96df3a3be

I think you should have a “this is a new branch” condition in the conditions section.

Thanks for the speedy response, that sounds like what I want, but in Herald all I see for this rule type that seems vaguely relevant is:

Ref type / is|is not / branch|tag|ref
Ref change type / has bit|has not bit / change creates|deletes|rewrites ref

Perhaps Ref type is branch && Ref change type has bit creates ?

Did you try “creates ref”?
“Has bit” also sounds valid, because you say you found a distinguishing bit.

I have added a condition:

Ref change type has bit change creates ref

Doesn’t seem testable in the console, so will wait for my user to try again to land their changes and see if they now don’t get caught.

1 Like