can we use `commit` if we don't have a `type`? the `if (commit)` should be in type if brackets