generate cursor diff