simplified impl of addCommit