last commit with query as function