use --porcelain, use simple state machine